Skip to content
Snippets Groups Projects
Commit a9e439ed authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: report regression flag to machine learning model

parent dacca88e
No related branches found
No related tags found
No related merge requests found
Showing
with 10 additions and 0 deletions
......@@ -74,6 +74,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
}
model->Load(modelPath);
model->SetRegressionMode(this->m_RegressionFlag);
model->SetInputListSample(validationListSample);
model->SetTargetListSample(predictedList);
model->PredictAll();
......
......@@ -66,6 +66,7 @@ namespace Wrapper
std::string modelPath)
{
typename BoostType::Pointer boostClassifier = BoostType::New();
boostClassifier->SetRegressionMode(this->m_RegressionFlag);
boostClassifier->SetInputListSample(trainingListSample);
boostClassifier->SetTargetListSample(trainingLabeledListSample);
boostClassifier->SetBoostType(GetParameterInt("classifier.boost.t"));
......
......@@ -93,6 +93,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
std::string modelPath)
{
typename DecisionTreeType::Pointer classifier = DecisionTreeType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
classifier->SetTargetListSample(trainingLabeledListSample);
classifier->SetMaxDepth(GetParameterInt("classifier.dt.max"));
......
......@@ -79,6 +79,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
std::string modelPath)
{
typename GradientBoostedTreeType::Pointer classifier = GradientBoostedTreeType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
classifier->SetTargetListSample(trainingLabeledListSample);
classifier->SetWeakCount(GetParameterInt("classifier.gbt.w"));
......
......@@ -47,6 +47,7 @@ namespace Wrapper
std::string modelPath)
{
typename KNNType::Pointer knnClassifier = KNNType::New();
knnClassifier->SetRegressionMode(this->m_RegressionFlag);
knnClassifier->SetInputListSample(trainingListSample);
knnClassifier->SetTargetListSample(trainingLabeledListSample);
knnClassifier->SetK(GetParameterInt("classifier.knn.k"));
......
......@@ -58,6 +58,7 @@ namespace Wrapper
std::string modelPath)
{
typename LibSVMType::Pointer libSVMClassifier = LibSVMType::New();
libSVMClassifier->SetRegressionMode(this->m_RegressionFlag);
libSVMClassifier->SetInputListSample(trainingListSample);
libSVMClassifier->SetTargetListSample(trainingLabeledListSample);
//SVM Option
......
......@@ -131,6 +131,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
std::string modelPath)
{
typename NeuralNetworkType::Pointer classifier = NeuralNetworkType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
classifier->SetTargetListSample(trainingLabeledListSample);
......
......@@ -42,6 +42,7 @@ namespace Wrapper
std::string modelPath)
{
typename NormalBayesType::Pointer classifier = NormalBayesType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
classifier->SetTargetListSample(trainingLabeledListSample);
classifier->Train();
......
......@@ -107,6 +107,7 @@ LearningApplicationBase<TInputValue,TOutputValue>
std::string modelPath)
{
typename RandomForestType::Pointer classifier = RandomForestType::New();
classifier->SetRegressionMode(this->m_RegressionFlag);
classifier->SetInputListSample(trainingListSample);
classifier->SetTargetListSample(trainingLabeledListSample);
classifier->SetMaxDepth(GetParameterInt("classifier.rf.max"));
......
......@@ -87,6 +87,7 @@ namespace Wrapper
std::string modelPath)
{
typename SVMType::Pointer SVMClassifier = SVMType::New();
SVMClassifier->SetRegressionMode(this->m_RegressionFlag);
SVMClassifier->SetInputListSample(trainingListSample);
SVMClassifier->SetTargetListSample(trainingLabeledListSample);
switch (GetParameterInt("classifier.svm.k"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment