<commit_before>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2012 <NAME>
 * Copyright (C) 2012 <NAME>
 */

#ifndef _QDA_H__
#define _QDA_H__

#include <shogun/lib/config.h>

#ifdef HAVE_LAPACK

#include <shogun/features/DotFeatures.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/machine/Machine.h>
#include <shogun/lib/SGNDArray.h>

namespace shogun
{

//#define DEBUG_QDA

/** @brief Class QDA implements Quadratic Discriminant Analysis.
 *
 *  TODO
 */
class CQDA : public CMachine
{
	public:
		/** constructor
		 *
		 * @param tolerance tolerance used in training
		 * @param store_covs whether to store the within class covariances
		 */
		CQDA(float64_t tolerance = 1e-4, bool store_covs = false);

		/** constructor
		 *
		 * @param traindat training features<commit_msg>+ little doc QDA #418<commit_after>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2012 <NAME>
 * Copyright (C) 2012 <NAME>
 */

#ifndef _QDA_H__
#define _QDA_H__

#include <shogun/lib/config.h>

#ifdef HAVE_LAPACK

#include <shogun/features/DotFeatures.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/machine/Machine.h>
#include <shogun/lib/SGNDArray.h>

namespace shogun
{

//#define DEBUG_QDA

/** @brief Class QDA implements Quadratic Discriminant Analysis.
 *
 *  QDA learns a quadratic classifier and requires examples to be CSimplefeatures.
 *  This classifier is optimal under the assumptions that the classes are normally
 *  distributed (i.e. they are Gaussians). Unlike LDA, QDA does not assume that all
 *  the classes are distributed with equal co-variance.
 *  TODO
 */
class CQDA : public CMachine
{
	public:
		/** constructor
		 *
		 * @param tolerance tolerance used in training
		 * @param store_covs whether to store the within class covariances
		 */
		CQDA(float64_t tolerance = 1e-4, bool store_covs = false);

		/** constructor
		 *
		 * @param traindat training features
{'fraction_non_alphanumeric': 0.09218351741716228, 'fraction_numerical': 0.01231945624468989, 'mean_word_length': 3.90625, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6019570', 'n_tokens_mistral': 794, 'n_tokens_neox': 732, 'n_words': 266}