Weka (KnowledgeFlow) - Part VI: Model validation using cross-validation and/or independent validation set
The previous post already provides the steps for model validation using cross-validation. So how do we validate a model using an independent validation set?
Validate model on an independent validation set
- Put ArffLoader component (DataSources) to layout area and configure it to load a training set from a file.
- Put ClassAssigner component (Filters) to layout area and connect the dataSet connection from the ArffLoader component to it.
- Configure it by setting the classIndex to the class column.
- Put TrainingSetMaker component (Evaluation) to layout area and connect the dataSet connection from the ClassAssigner component to it.
- Put ArffLoader component (DataSources) to layout area and configure it to load an independent validation set from a file.
- Put ClassAssigner component (Filters) to layout area and connect the dataSet connection from the ArffLoader component to it.
- Configure it by setting the classIndex to the class column.
- Put TestSetMaker component (Evaluation) to layout area and connect the dataSet connection from the ClassAssigner component to it.
- Put SMO component (Classifiers) to layout area and connect the trainingSet connection from the TrainingSetMaker component and the testSet connection from the TestSetMaker component to it.
- Configure it by choosing RBFKernel and setting the gamma value for the kernel to 0.01.
- Put ClassifierPerformanceEvaluator component (Evaluation) to layout and connect the batchClassifier connection from the SMO component to it.
- Put TextViewer component (Visualization) to layout and connect the text connection from the ClassifierPerformanceEvaluator component to it.
- Run.
It can be seen that KnowledgeFlow is able to validate a model using either cross-validation or an independent validation set. However, it seems that KnowledgeFlow is unable to save a model and thus the model has to be rebuild each time it is to be used for validating an independent validation set.
Share This