SG++-Doxygen-Documentation
|
#include <AlgorithmAdaBoostIdentity.hpp>
Public Member Functions | |
AlgorithmAdaBoostIdentity (base::Grid &SparseGrid, size_t gridType, base::level_t gridLevel, base::DataMatrix &trainData, base::DataVector &trainDataClass, size_t NUM, double lambda, size_t IMAX, double eps, size_t IMAX_final, double eps_final, double firstLabel, double secondLabel, double threshold, double maxLambda, double minLambda, size_t searchNum, bool refine, size_t refineMode, size_t refineNum, size_t numberOfAda, double percentOfAda, size_t mode) | |
Std-Constructor. More... | |
virtual | ~AlgorithmAdaBoostIdentity () |
Std-Deconstructor. More... | |
Public Member Functions inherited from sgpp::datadriven::AlgorithmAdaBoostBase | |
AlgorithmAdaBoostBase (base::Grid &SparseGrid, size_t gridType, base::level_t gridLevel, base::DataMatrix &trainData, base::DataVector &trainDataClass, size_t NUM, double lambda, size_t IMAX, double eps, size_t IMAX_final, double eps_final, double firstLabel, double secondLabel, double threshold, double maxLambda, double minLambda, size_t searchNum, bool refine, size_t refineMode, size_t refineNum, size_t numberOfAda, double percentOfAda, size_t mode) | |
Std-Constructor. More... | |
void | classif (base::DataMatrix &testData, base::DataVector &algorithmClassTrain, base::DataVector &algorithmClassTest, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest) |
Performs a classify for the testing dataset according to the baselearners get from the algorithm. More... | |
void | doAdaBoostR2 (base::DataMatrix &weights, base::DataMatrix &testData, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest, std::string lossFucType) |
Performs the Adaboost.R2(a regression algorithm) More... | |
void | doAdaBoostRT (base::DataMatrix &weights, base::DataMatrix &testData, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest, double Tvalue, std::string powerType) |
Performs the Adaboost.RT(a regression algorithm) More... | |
void | doDiscreteAdaBoost (base::DataVector &hypoWeight, base::DataVector &weightError, base::DataMatrix &weights, base::DataMatrix &decision, base::DataMatrix &testData, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest) |
Performs the Discrete Adaboost. More... | |
void | doRealAdaBoost (base::DataMatrix &weights, base::DataMatrix &testData, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest) |
Performs the Real Adaboost. More... | |
void | doRefinement (base::DataVector &alpha_ada, base::DataVector &weight_ada, size_t curBaseLearner) |
Performs refinement of grid to get an adaptive grid. More... | |
void | eval (base::DataMatrix &testData, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest) |
Performs a real value calculate for the testing dataset. More... | |
void | getAccuracy (base::DataMatrix &testData, base::DataVector &testDataClass, double *accuracy_train, double *accuracy_test) |
Performs an accuracy evaluation for the testing dataset. More... | |
void | getAccuracyBL (base::DataMatrix &testData, base::DataVector &testDataClass, base::DataMatrix &algorithmValueTrain, base::DataMatrix &algorithmValueTest, double *accuracy_train, double *accuracy_test, size_t yourBaseLearner) |
Performs an accuracy evaluation for the testing dataset with a specified number of base learner. More... | |
size_t | getActualBL () |
Get the actual base learners after doing adaboosting. More... | |
size_t | getMaxGridPoint (size_t baseLearner) |
Get the max GridPoint ever used in adaboosting. More... | |
size_t | getMeanGridPoint (size_t baseLearner) |
Get the mean GridPoint ever used in adaboosting. More... | |
void | getROC (base::DataMatrix &validationData, base::DataVector &validationDataClass, double *acc, double *sensitivity, double *specificity, double *precision, double *recall, double *fOneScore) |
Performs an evaluation to get ROC related parameter. More... | |
size_t | getSumGridPoint (size_t baseLearner) |
Get the sum GridPoint ever used in adaboosting. More... | |
double | hValue (double realValue) |
Performs a hypothesis classifier. More... | |
virtual | ~AlgorithmAdaBoostBase () |
Std-Deconstructor. More... | |
Protected Member Functions | |
virtual void | alphaSolver (double &lambda, base::DataVector &weight, base::DataVector &alpha, bool final) |
Performs a solver to get alpha use DMWeightMatrix as the System Matrix. More... | |
Additional Inherited Members | |
Protected Attributes inherited from sgpp::datadriven::AlgorithmAdaBoostBase | |
size_t | actualBaseLearners |
Actual base learners number for Adaboosting. More... | |
size_t | boostMode |
Set the boost mode (1: Discrete Adaboost, 2: Real Adaboost) More... | |
base::DataVector * | classes |
Pointer to the class(real value in regression) of the data vector. More... | |
base::DataMatrix * | data |
Pointer to the data matrix. More... | |
size_t | dim |
DataSet Dimension. More... | |
double | epsilon |
Parameter for CG solver(during the refinement) More... | |
double | epsilon_final |
Parameter for CG solver(for the last refinement) More... | |
base::Grid * | grid |
the grid More... | |
size_t | gridPoint |
Number of grid points. More... | |
size_t | imax |
Parameter for CG solver(during the refinement) More... | |
size_t | imax_final |
Parameter for CG solver(for the last refinement) More... | |
double | labelOne |
One label of the DataSet. More... | |
double | labelTwo |
Another label of the DataSet. More... | |
double | lamb |
the lambda, the regularisation parameter More... | |
double | lambLogMax |
Log of the Max lambda in searching for optimal lambda. More... | |
size_t | lambSteps |
Number of iteration in searching for optimal lambda. More... | |
double | lambStepsize |
Interval size with logrange used in searching optimal lambda. More... | |
base::level_t | level |
grid level More... | |
base::DataVector * | maxGridPoint |
Number of the maximum grid points used in the algorithm. More... | |
size_t | numBaseLearners |
Number of base learner for Adaboosting. More... | |
size_t | numData |
the size of the grid More... | |
size_t | numOfAda |
Number of Grid points to refine. More... | |
double | perOfAda |
Percentage of Grid points to refine(between 0 and 1) More... | |
bool | refinement |
Judgement of grid refine. More... | |
size_t | refineMode |
Select the refine mode(1:use grid number, 2: use grid number percentage) More... | |
size_t | refineTimes |
Number of refinement with a certain percentage of Grid points. More... | |
base::DataVector * | sumGridPoint |
Number of the sum grid points used in the algorithm. More... | |
double | threshold |
Threshold to predict class. More... | |
size_t | type |
type of grid possible value are 1, 2 or 3(1 = Linear Grid, 2 = LinearL0Boundary Grid, 3 = ModLinear Grid); More... | |
sgpp::datadriven::AlgorithmAdaBoostIdentity::AlgorithmAdaBoostIdentity | ( | base::Grid & | SparseGrid, |
size_t | gridType, | ||
base::level_t | gridLevel, | ||
base::DataMatrix & | trainData, | ||
base::DataVector & | trainDataClass, | ||
size_t | NUM, | ||
double | lambda, | ||
size_t | IMAX, | ||
double | eps, | ||
size_t | IMAX_final, | ||
double | eps_final, | ||
double | firstLabel, | ||
double | secondLabel, | ||
double | threshold, | ||
double | maxLambda, | ||
double | minLambda, | ||
size_t | searchNum, | ||
bool | refine, | ||
size_t | refineMode, | ||
size_t | refineNum, | ||
size_t | numberOfAda, | ||
double | percentOfAda, | ||
size_t | mode | ||
) |
Std-Constructor.
SparseGrid | reference to the sparse grid |
gridType | reference to the of grid type(1 = Linear Grid, 2 = LinearL0Boundary Grid, 3 = ModLinear Grid) |
gridLevel | reference to the level of grid |
trainData | reference to the training dataset |
trainDataClass | reference to the class of training dataset |
NUM | the number of baselearner for Adaboosting |
lambda | the regularisation parameter |
IMAX | the parameter for ConjugateGradients |
eps | the parameter for ConjugateGradients |
IMAX_final | the parameter for ConjugateGradients used for last refinement step |
eps_final | the parameter for ConjugateGradients used for last refinement step |
firstLabel | one label from training dataset |
secondLabel | another label from training dataset |
threshold | the parameter for predicting a class |
maxLambda | the max lambda used in searching optimal lambda |
minLambda | the min lambda used in searching optimal lambda |
searchNum | the searching times used in searching for optimal lambda |
refine | the judgement of refine |
refineMode | Select the refine mode |
refineNum | the Number of refinement with a certain percentage of Grid points |
numberOfAda | the number of Grid points to refine |
percentOfAda | the percentage of Grid points to refine |
mode | the adaboost type to choose |
|
virtual |
Std-Deconstructor.
|
protectedvirtual |
Performs a solver to get alpha use DMWeightMatrix as the System Matrix.
lambda | the regularisation parameter |
weight | the weights of examples |
alpha | output the coefficients of the sparse grid's basis functions |
final | judgement the final step of this base learner |
Implements sgpp::datadriven::AlgorithmAdaBoostBase.
References python.utils.pca_normalize_dataset::C, sgpp::datadriven::AlgorithmAdaBoostBase::classes, sgpp::op_factory::createOperationIdentity(), sgpp::datadriven::AlgorithmAdaBoostBase::data, sgpp::datadriven::AlgorithmAdaBoostBase::epsilon, sgpp::datadriven::AlgorithmAdaBoostBase::epsilon_final, sgpp::datadriven::DMWeightMatrix::generateb(), sgpp::base::DataVector::getSize(), sgpp::datadriven::AlgorithmAdaBoostBase::grid, sgpp::datadriven::AlgorithmAdaBoostBase::imax, sgpp::datadriven::AlgorithmAdaBoostBase::imax_final, and sgpp::solver::ConjugateGradients::solve().