[mlpack] 04/44: Backport r17187.

Barak A. Pearlmutter barak+git at pearlmutter.net
Mon Feb 15 19:35:52 UTC 2016


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

bap pushed a commit to tag mlpack-1.0.11
in repository mlpack.

commit 5ca37465b5cdefa1d7791729beb8cde9d44fd990
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sun Dec 7 19:13:18 2014 +0000

    Backport r17187.
---
 HISTORY.txt                                                | 2 ++
 src/mlpack/methods/linear_regression/linear_regression.cpp | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/HISTORY.txt b/HISTORY.txt
index 3ca4612..5895e74 100644
--- a/HISTORY.txt
+++ b/HISTORY.txt
@@ -2,6 +2,8 @@
 
   * Proper handling of dimension calculation in PCA.
 
+  * Load parameter vectors properly for LinearRegression models.
+
 2014-08-29    mlpack 1.0.10
 
   * Bugfix for NeighborSearch regression which caused very slow allknn/allkfn.
diff --git a/src/mlpack/methods/linear_regression/linear_regression.cpp b/src/mlpack/methods/linear_regression/linear_regression.cpp
index 8b231fc..0bdd718 100644
--- a/src/mlpack/methods/linear_regression/linear_regression.cpp
+++ b/src/mlpack/methods/linear_regression/linear_regression.cpp
@@ -88,7 +88,9 @@ LinearRegression::LinearRegression(const arma::mat& predictors,
 LinearRegression::LinearRegression(const std::string& filename) :
     lambda(0.0)
 {
-  data::Load(filename, parameters, true);
+  arma::mat parameter;
+  data::Load(filename, parameter, true);
+  parameters = parameter.unsafe_col(0);
 }
 
 LinearRegression::LinearRegression(const LinearRegression& linearRegression) :

-- 
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