Last change
on this file since 34444 was 34444, checked in by davidb, 4 years ago |
Notes on how load save and load a Weka model
|
File size:
386 bytes
|
Line | |
---|
1 |
|
---|
2 | https://stackoverflow.com/questions/33556543/how-to-save-model-and-apply-it-on-a-test-dataset-on-java
|
---|
3 |
|
---|
4 |
|
---|
5 | For versions greater than 3.5.5 it's as simple as:
|
---|
6 |
|
---|
7 | J48 j48 = new J48();
|
---|
8 | j48.buildClassifier(train);
|
---|
9 | weka.core.SerializationHelper.write("/some/where/j48.model", j48);
|
---|
10 |
|
---|
11 | And loading is just:
|
---|
12 |
|
---|
13 | Classifier cls = (Classifier) weka.core.SerializationHelper.read("/some/where/j48.model")
|
---|
Note:
See
TracBrowser
for help on using the repository browser.