<p>In <a href="https://github.com/mlpack/mlpack/pull/466#discussion_r43379700">src/mlpack/methods/softmax_regression/softmax_main.cpp</a>:</p>
<pre style='color:#555'>> + //data::Load(labelFile, trainLabels, true);
> +
> + std::cout<<trainData<<"\n\n";
> + std::cout<<trainLabels<<"\n\n";
> + if(trainData.n_cols != trainLabels.n_elem)
> + {
> + Log::Fatal << "Samples of input_data should same as the size "
> + "of input_label " << std::endl;
> + }
> +
> + size_t numClasses = CLI::GetParam<int>("number_of_classes");
> + if(numClasses == 0){
> + const std::set<size_t> unique_labels(std::begin(trainLabels),
> + std::end(trainLabels));
> + numClasses = unique_labels.size();
> + }
</pre>
<p>I think <code>data::NormalizeLabels()</code> will do what you want here.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/466/files#r43379700">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFDVKm2E6Z9XdFOApPtOg3Hb9v36fks5pAgxVgaJpZM4GX7Ld.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/466/files#r43379700"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>