You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2009/07/05 15:32:15 UTC
[jira] Resolved: (MATH-279) MultipleLinearRegression - test for
minimum number of samples
[ https://issues.apache.org/jira/browse/MATH-279?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luc Maisonobe resolved MATH-279.
--------------------------------
Resolution: Fixed
Assignee: Luc Maisonobe
fixed in subversion repository as of r791244
patch was only slightly modified to avoid a NPE
thanks for the patch
> MultipleLinearRegression - test for minimum number of samples
> -------------------------------------------------------------
>
> Key: MATH-279
> URL: https://issues.apache.org/jira/browse/MATH-279
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Michael Bjorkegren
> Assignee: Luc Maisonobe
> Priority: Minor
> Fix For: 2.0
>
> Original Estimate: 0.17h
> Remaining Estimate: 0.17h
>
> It's currently possible to pass in so few rows (samples) that there isn't a row for each column (predictor). Does this look like the right thing to do?
> {code}
> Index: AbstractMultipleLinearRegression.java
> ===================================================================
> --- AbstractMultipleLinearRegression.java (revision 786758)
> +++ AbstractMultipleLinearRegression.java (working copy)
> @@ -91,6 +91,9 @@
> "dimension mismatch {0} != {1}",
> (x == null) ? 0 : x.length,
> (y == null) ? 0 : y.length);
> + } else if (x[0].length > x.length){
> + throw MathRuntimeException.createIllegalArgumentException(
> + "not enough data (" + x.length + " rows) for this many predictors (" + x[0].length + " predictors)");
> }
> }
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.