[mlpack-git] [mlpack] implement command line programs of softmaxRegression (#466)

Ryan Curtin notifications at github.com
Thu Oct 29 08:45:09 EDT 2015


> +  //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();
> +  }

I think `data::NormalizeLabels()` will do what you want here.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/466/files#r43379700
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20151029/a7847175/attachment-0001.html>


More information about the mlpack-git mailing list