Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0
-
None
-
None
Description
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?
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)"); } }