SG++-Doxygen-Documentation
sgpp::datadriven::ClassificationLearner Class Reference

The ClassificationLearner class Solves a classification problem. More...

#include <ClassificationLearner.hpp>

Public Member Functions

 ClassificationLearner (sgpp::base::RegularGridConfiguration gridConfig, sgpp::base::AdaptivityConfiguration adaptivityConfig, sgpp::solver::SLESolverConfiguration solverConfig, sgpp::solver::SLESolverConfiguration finalSolverConfig, sgpp::datadriven::RegularizationConfiguration regularizationConfig, std::vector< std::vector< size_t >> terms)
 ClassificationLearner. More...
 
 ClassificationLearner (sgpp::base::RegularGridConfiguration gridConfig, sgpp::base::AdaptivityConfiguration adaptivityConfig, sgpp::solver::SLESolverConfiguration solverConfig, sgpp::solver::SLESolverConfiguration finalSolverConfig, sgpp::datadriven::RegularizationConfiguration regularizationConfig)
 ClassificationLearner. More...
 
double getAccuracy (sgpp::base::DataMatrix &data, const sgpp::base::DataVector &y)
 getAccuracy More...
 
size_t getGridSize () const
 getGridSize More...
 
sgpp::base::DataVector predict (sgpp::base::DataMatrix &data)
 predict More...
 
std::pair< sgpp::base::DataVector, sgpp::base::DataVectorpredictWithCertainty (sgpp::base::DataMatrix &data)
 predict More...
 
void train (sgpp::base::DataMatrix &trainDataset, sgpp::base::DataVector &classes)
 train fits a sparse grid regression model. More...
 

Detailed Description

The ClassificationLearner class Solves a classification problem.

Constructor & Destructor Documentation

sgpp::datadriven::ClassificationLearner::ClassificationLearner ( sgpp::base::RegularGridConfiguration  gridConfig,
sgpp::base::AdaptivityConfiguration  adaptivityConfig,
sgpp::solver::SLESolverConfiguration  solverConfig,
sgpp::solver::SLESolverConfiguration  finalSolverConfig,
sgpp::datadriven::RegularizationConfiguration  regularizationConfig,
std::vector< std::vector< size_t >>  terms 
)

ClassificationLearner.

Parameters
gridConfig
adaptivityConfig
solverConfigis the solver used during each adaptivity step
finalSolverConfigis the solver used to build the final model
regularizationConfig
termsis a vector that contains all desired interaction terms. For example, if we want to include grid points that model an interaction between the first and the second predictor, we would include the vector [1,2] in terms.
sgpp::datadriven::ClassificationLearner::ClassificationLearner ( sgpp::base::RegularGridConfiguration  gridConfig,
sgpp::base::AdaptivityConfiguration  adaptivityConfig,
sgpp::solver::SLESolverConfiguration  solverConfig,
sgpp::solver::SLESolverConfiguration  finalSolverConfig,
sgpp::datadriven::RegularizationConfiguration  regularizationConfig 
)

ClassificationLearner.

Parameters
gridConfig
adaptivityConfig
solverConfigis the solver used during each adaptivity step
finalSolverConfigis the solver used to build the final model
regularizationConfig

Member Function Documentation

double sgpp::datadriven::ClassificationLearner::getAccuracy ( sgpp::base::DataMatrix data,
const sgpp::base::DataVector y 
)

getAccuracy

Parameters
datais the design matrix
yis the target
Returns
the accuracy of the prediction of the model for the matrix data

References sgpp::base::DataVector::getSize(), python.statsfileInfo::i, and predict().

size_t sgpp::datadriven::ClassificationLearner::getGridSize ( ) const

getGridSize

Returns
the grid size
sgpp::base::DataVector sgpp::datadriven::ClassificationLearner::predict ( sgpp::base::DataMatrix data)

predict

Parameters
dataare observations
Returns
the predicted target for matrix data

References sgpp::base::DataMatrix::getNrows(), and python.statsfileInfo::i.

Referenced by getAccuracy().

std::pair< sgpp::base::DataVector, sgpp::base::DataVector > sgpp::datadriven::ClassificationLearner::predictWithCertainty ( sgpp::base::DataMatrix data)

predict

Parameters
dataare observations
Returns
the predicted target for matrix data and the certainty of the model, that the observation belongs to the predicted class.

References python.statsfileInfo::data, sgpp::base::DataMatrix::getNrows(), and python.statsfileInfo::i.

void sgpp::datadriven::ClassificationLearner::train ( sgpp::base::DataMatrix trainDataset,
sgpp::base::DataVector classes 
)

train fits a sparse grid regression model.

Parameters
trainDatasetis the design matrix
classesis the (continuous) target

References sgpp::base::DataVector::getSize(), and python.statsfileInfo::i.


The documentation for this class was generated from the following files: