Closed mkffl closed 3 years ago
Please also note that I can't reproduce the examples based on loading files, e.g. weka weather file. That's because the command import smile.io
used in the documentation throws an error object io is not a member of package smile
.
I think that running these examples would help me guess what format is expected. Would be great to know how to load the i/o and parsing functionality.
To use smile.io
, you should add smile-io
module into your project. And your example is wrong because x
is a one-dimensional array. Machine learning is for multi-dimensional data analysis.
Thanks, I now have access to the smile-io
package - that's great.
I will try adding another predictor, though I am not sure this will fix the issue. xtrain
is chucked into the DataFrame alongside ytrain
without any issue, and smile.regression.RandomForest
runs with no issues, which suggests the input data is ok.
I believe the issue may be with ytrain
being inserted into the DataFrame as a Double type, which is not compatible with the toIntArray
method. I tried to insert different field types with a custom schema object but no luck so far.
Thanks for your help.
I need to fit a rf model for classification. I cook up the formula and the dataFrame according to Smile's specifications, but an errors comes up when I use the fit method.
I would expect the code to compile as in the documentation snippets.
Is my input badly formatted? FYI This question includes the same error message, however, it seems the user was using the classification model for a regression problem.
Code and error stack trace:
The last line returns:
Ammonite Repl 2.3.8 Scala 2.13.3 Java 15.0.1