[mlpack-svn] r17104 - mlpack/trunk/src/mlpack/methods/linear_regression
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Sat Aug 23 17:42:42 EDT 2014
Author: michaelfox99
Date: Sat Aug 23 17:42:42 2014
New Revision: 17104
Log:
intercept no longer penalized and can be turned off, observation weights now supported
Modified:
mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp
Modified: mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp (original)
+++ mlpack/trunk/src/mlpack/methods/linear_regression/linear_regression.hpp Sat Aug 23 17:42:42 2014
@@ -1,6 +1,7 @@
/**
* @file linear_regression.hpp
* @author James Cline
+ * @author Michael Fox
*
* Simple least-squares linear regression.
*/
@@ -26,10 +27,15 @@
* @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 @@
* 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-svn
mailing list