diff --git a/src/mlpack/methods/adaboost/adaboost_main.cpp b/src/mlpack/methods/adaboost/adaboost_main.cpp index c6fceb2495..a439563ef7 100644 --- a/src/mlpack/methods/adaboost/adaboost_main.cpp +++ b/src/mlpack/methods/adaboost/adaboost_main.cpp @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) // defining the number of iterations of the perceptron. int iter = 400; - perceptron::Perceptron<> p(trainingData, labels.t(), iter); + perceptron::Perceptron<> p(trainingData, labels.t(), max(labels) + 1, iter); Timer::Start("Training"); AdaBoost<> a(trainingData, labels.t(), iterations, tolerance, p); @@ -143,4 +143,4 @@ int main(int argc, char *argv[]) const string outputFilename = CLI::GetParam("output_file"); data::Save(outputFilename, results, true, false); return 0; -} \ No newline at end of file +}