SG++-Doxygen-Documentation
|
The ClassificationLearner class Solves a classification problem. More...
#include <ClassificationLearner.hpp>
The ClassificationLearner class Solves a classification problem.
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 | ||
) |
gridConfig | |
adaptivityConfig | |
solverConfig | is the solver used during each adaptivity step |
finalSolverConfig | is the solver used to build the final model |
regularizationConfig | |
terms | is 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 | ||
) |
gridConfig | |
adaptivityConfig | |
solverConfig | is the solver used during each adaptivity step |
finalSolverConfig | is the solver used to build the final model |
regularizationConfig |
double sgpp::datadriven::ClassificationLearner::getAccuracy | ( | sgpp::base::DataMatrix & | data, |
const sgpp::base::DataVector & | y | ||
) |
getAccuracy
data | is the design matrix |
y | is the target |
References sgpp::base::DataVector::getSize(), python.statsfileInfo::i, and predict().
size_t sgpp::datadriven::ClassificationLearner::getGridSize | ( | ) | const |
getGridSize
sgpp::base::DataVector sgpp::datadriven::ClassificationLearner::predict | ( | sgpp::base::DataMatrix & | data | ) |
predict
data | are observations |
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
data | are observations |
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.
trainDataset | is the design matrix |
classes | is the (continuous) target |
References sgpp::base::DataVector::getSize(), and python.statsfileInfo::i.