commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (MATH-279) MultipleLinearRegression - test for minimum number of samples
Date Sun, 05 Jul 2009 13:32:15 GMT

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


Mime
View raw message