Hi,
I am a computer sciences teacher. Two of my students created an app for drawing graphs and ran across the following bug: when you create a ChartData by adding points and you try to plot a Quadratic graph, you get the following error message (although the graph is plotter OK) :
| org.apache.commons.math3.exception.MathIllegalArgumentException: not enough data (3 rows) for this many predictors (3 predictors) at org.apache.commons.math3.stat.regression.AbstractMultipleLinearRegression.validateSampleData(AbstractMultipleLinearRegression.java:235) at org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression.newSampleData(OLSMultipleLinearRegression.java:90) at com.google.appinventor.components.runtime.util.OlsTrendLine.compute(OlsTrendLine.java:90) at com.google.appinventor.components.runtime.util.QuadraticRegression.compute(QuadraticRegression.java:34) at com.google.appinventor.components.runtime.Trendline.onDataSourceValueChange(Trendline.java:186) at com.google.appinventor.components.runtime.ChartDataBase.onDataChange(ChartDataBase.java:274) at com.google.appinventor.components.runtime.ChartData2D$1.run(ChartData2D.java:84) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1154) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:652) at java.lang.Thread.run(Thread.java:1564) Note: You will not see another error reported for 5 seconds. |
|
|---|---|
I am attaching an AIA file of a project I created that demonstrates the problem (I left only the relevant parts).
A workaround to solve this is by creating a list in the same format that ChartData represents, and importing it (this is the variable YYDebug in the code), but still the bug in adding points exists and should be addressed.
Thank you!
Yossi Yaron
Graphs_TR.aia (3.5 KB)


