[mlpack] 47/58: intercept no longer penalized and can be turned off, observation weights now supported

Barak A. Pearlmutter barak+git at cs.nuim.ie
Tue Sep 9 13:19:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit b25ff0cea5cd023cb614116fb463ab830abdaa17
Author: michaelfox99 <michaelfox99 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Sat Aug 23 21:42:42 2014 +0000

    intercept no longer penalized and can be turned off, observation weights now supported
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17104 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/linear_regression/linear_regression.hpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/linear_regression/linear_regression.hpp b/src/mlpack/methods/linear_regression/linear_regression.hpp
index 265e290..7959a67 100644
--- a/src/mlpack/methods/linear_regression/linear_regression.hpp
+++ b/src/mlpack/methods/linear_regression/linear_regression.hpp
@@ -1,6 +1,7 @@
 /**
  * @file linear_regression.hpp
  * @author James Cline
+ * @author Michael Fox
  *
  * Simple least-squares linear regression.
  */
@@ -26,10 +27,15 @@ class LinearRegression
    * @param predictors X, matrix of data points to create B with.
    * @param responses y, the measured data for each point in X
    * @param lambda regularization constant
+   * @param intercept include intercept?
+   * @param weights observation weights
    */
   LinearRegression(const arma::mat& predictors,
                    const arma::vec& responses,
-                   const double lambda = 0);
+                   const double lambda = 0,
+                   const bool intercept = true,
+                   const arma::vec& weights = arma::vec()
+                   );
 
   /**
    * Initialize the model from a file.
@@ -97,12 +103,13 @@ class LinearRegression
    * Initialized and filled by constructor to hold the least squares solution.
    */
   arma::vec parameters;
-
   /**
    * The Tikhonov regularization parameter for ridge regression (0 for linear
    * regression).
    */
   double lambda;
+  //! Indicates whether last parameter is intercept.
+  bool intercept;
 };
 
 }; // namespace linear_regression

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list