[mlpack-git] [mlpack] Enhance SoftmaxRegression (#457)

Ryan Curtin notifications at github.com
Tue Sep 29 08:26:27 EDT 2015


> @@ -141,13 +140,8 @@ class SoftmaxRegression
>     * @param numClasses Number of classes for classification.
>     * @return Objective value of the final point.
>     */
> -  double Train(const arma::mat &data, const arma::vec& labels,
> -               const size_t numClasses);
> -
> -  //! Sets the size of the input vector.
> -  size_t& InputSize() { return inputSize; }
> -  //! Gets the size of the input vector.
> -  size_t InputSize() const { return inputSize; }

Hm, I think maybe it would be useful to keep `InputSize()`, because the length of the parameters vector may differ depending on the value of `fitIntercept`.  Maybe:

```
size_t InputSize() const { return (fitIntercept ? parameters.n_rows - 1 : parameters.n_rows); }
```

This doesn't allow the users to set the input size or anything (that can be done by re-training or other means), but it does allow the users to determine what the correct size of their input vectors should be.  What do you think?

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/457/files#r40664268
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150929/3b7f2c7b/attachment.html>


More information about the mlpack-git mailing list