You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You may notice that none of models supports Java Serializable interface. It is because the exact format is hard to keep stable,
109
+
You may notice that most models supports Java `Serializable` interface (all classifiers do support `Serializable` interface). It is because the exact format is hard to keep stable,
110
110
class changes can easily make your serialized data unreadable, reading/writing the data in non-Java code is almost impossible.
111
-
Currently, we suggest <ahref="http://xstream.codehaus.org">XStream</a> to serialize the trained models.
111
+
Currently, we suggest [XStream](http://xstream.codehaus.org) to serialize the trained models.
112
112
XStream is a simple library to serialize objects to XML and back again. XStream is easy to use and doesn't require mappings
113
-
(actually requires no modifications to objects). <ahref="http://code.google.com/p/protostuff/">Protostuff</a> is a
113
+
(actually requires no modifications to objects). [Protostuff](http://code.google.com/p/protostuff/) is a
114
114
nice alternative that supports forward-backward compatibility (schema evolution) and validation.
115
115
Beyond XML, Protostuff supports many other formats such as JSON, YAML, protobuf, etc. For some predicitive models,
116
116
we look forward to supporting PMML (Predictive Model Markup Language), an XML-based file format developed by the Data Mining Group.
@@ -236,11 +236,15 @@ Most Smile algorithms take simple double[] as input. So you can use your favorit
double[][] x = weather.toArray(newdouble[weather.size()][]);
241
241
int[] y = weather.toArray(newint[weather.size()]);
242
242
```
243
-
Note that the data file weather.nominal.arff is not included in the release. To try out the example, please just download any arff file from Internet. In the second line, we use setResponseIndex to set the column index (starting at 0) of dependent/response variable. In supervised learning, we need a response variable for each sample to train the model. Basically, it is the _y_ in the mathematical model. For classification, it is the class label. For regression, it is of real value. Without setting it, the data assume no response variable. In that case, the data can be used for testing or unsupervised learning.
243
+
Note that the data file weather.nominal.arff is in Smile distribution package.
244
+
After unpack the package, there are a lot of testing data in the directory of
245
+
`$smile/data`, where `$smile` is the the root of Smile package.
246
+
247
+
In the second line, we use setResponseIndex to set the column index (starting at 0) of dependent/response variable. In supervised learning, we need a response variable for each sample to train the model. Basically, it is the _y_ in the mathematical model. For classification, it is the class label. For regression, it is of real value. Without setting it, the data assume no response variable. In that case, the data can be used for testing or unsupervised learning.
244
248
245
249
The parse method can take a URI, File, path string, or InputStream as input argument. And it returns an AttributeDataset object, which is a dataset of a number of attributes. All attribute values are stored as double even if the attribute may be nominal, ordinal, string, or date. The first call of toArray taking a double[][] argument fills the array with all the parsed data and returns it, of which each row is a sample/object. The second call of toArray taking an int array fills it with the class labels of the samples and then returns it.
246
250
@@ -250,7 +254,7 @@ Similar to ArffParser, we can also use the DelimitedTextParser class to parse pl
where the setResponseIndex also take an extra parameter about the attribute of response variable. Because this is a classification problem, we set it a NominalAttribute with name "class". In case of regression, we should use NumericAttribute instead.
256
260
@@ -262,8 +266,8 @@ Smile implements a variety of classification and regression algorithms. In what
0 commit comments