[mlpack-git] master, mlpack-1.0.x: Const-correctness and 80-character lines... very trivial fix, no functionality change. (f05fd18)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:52:24 EST 2015


Repository : https://github.com/mlpack/mlpack

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit f05fd182c3fe0dae0ad5267d7e3dd0a878619611
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Jul 9 19:25:51 2014 +0000

    Const-correctness and 80-character lines... very trivial fix, no functionality
    change.


>---------------------------------------------------------------

f05fd182c3fe0dae0ad5267d7e3dd0a878619611
 src/mlpack/methods/decision_stump/decision_stump_impl.hpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/decision_stump/decision_stump_impl.hpp b/src/mlpack/methods/decision_stump/decision_stump_impl.hpp
index e30168f..cfe4388 100644
--- a/src/mlpack/methods/decision_stump/decision_stump_impl.hpp
+++ b/src/mlpack/methods/decision_stump/decision_stump_impl.hpp
@@ -37,9 +37,9 @@ DecisionStump<MatType>::DecisionStump(const MatType& data,
   // If classLabels are not all identical, proceed with training.
   int bestAtt = 0;
   double entropy;
-  double rootEntropy = CalculateEntropy<size_t>(labels.subvec(0,labels.n_elem-1));
-  // std::cout<<"rootEntropy is: "<<rootEntropy<<"\n";
-  // double bestEntropy = DBL_MAX;
+  const double rootEntropy = CalculateEntropy<size_t>(
+      labels.subvec(0, labels.n_elem - 1));
+
   double gain, bestGain = 0.0;
   for (int i = 0; i < data.n_rows; i++)
   {
@@ -61,7 +61,6 @@ DecisionStump<MatType>::DecisionStump(const MatType& data,
       if (gain < bestGain)
       {
         bestAtt = i;
-        // bestEntropy = entropy;
         bestGain = gain;
       }
     }



More information about the mlpack-git mailing list