Saving+and+loading+models

=Classifiers=

Commandline
You save a trained classifier with the option (//dumping//), e.g.: code format="bash" java weka.classifiers.trees.J48 -C 0.25 -M 2 -t /some/where/train.arff -d /other/place/j48.model code And you can load it with and use it on a test set, e.g.: code format="bash" java weka.classifiers.trees.J48 -l /other/place/j48.model -T /some/where/test.arff code Note, when loading a model you no longer need to supply specific parameters to the classifier.

Explorer
A trained model can be saved like this, e.g., J48:
 * train your model on the training data
 * right-click in the //Results list// on the item which model you want to save
 * select //Save model// and save it to

You can load the previously saved model with the following steps:
 * load your test data via the //Supplied test set// button
 * right-click in the //Results list//, select //Load model// and choose
 * select //Re-evaluate model on current test set//

Based on [|this] Weka Mailing List post.

Making Predictions with your model without retraining
See the Making predictions article for detailed information.

Source code
See Serialization for code examples.

=See also=
 * Serialization