[mlpack-git] master: intercept no longer penalized and can be turned off, observation weights now supported (b807398)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:59:38 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit b807398507cdc725c52bc1e236ddc94ff11285b4
Author: michaelfox99 <michaelfox99 at gmail.com>
Date: Sat Aug 23 21:42:42 2014 +0000
intercept no longer penalized and can be turned off, observation weights now supported
>---------------------------------------------------------------
b807398507cdc725c52bc1e236ddc94ff11285b4
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
More information about the mlpack-git
mailing list