Class LibSVMRegressionTrainer
java.lang.Object
org.tribuo.common.libsvm.LibSVMTrainer<Regressor>
org.tribuo.regression.libsvm.LibSVMRegressionTrainer
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable,com.oracle.labs.mlrg.olcut.provenance.Provenancable<TrainerProvenance>,Trainer<Regressor>
A trainer for regression models that uses LibSVM. Trains an independent model for each output dimension.
See:
Chang CC, Lin CJ. "LIBSVM: a library for Support Vector Machines" ACM transactions on intelligent systems and technology (TIST), 2011.for the nu-svr algorithm:
Schölkopf B, Smola A, Williamson R, Bartlett P L. "New support vector algorithms" Neural Computation, 2000, 1207-1245.and for the original algorithm:
Cortes C, Vapnik V. "Support-Vector Networks" Machine Learning, 1995.
-
Field Summary
Fields inherited from class org.tribuo.common.libsvm.LibSVMTrainer
parameters, svmTypeFields inherited from interface org.tribuo.Trainer
DEFAULT_SEED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFor olcut.LibSVMRegressionTrainer(SVMParameters<Regressor> parameters) -
Method Summary
Modifier and TypeMethodDescriptionprotected LibSVMModel<Regressor> createModel(ModelProvenance provenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Regressor> outputIDInfo, List<libsvm.svm_model> models) Construct the appropriate subtype of LibSVMModel for the prediction task.protected com.oracle.labs.mlrg.olcut.util.Pair<libsvm.svm_node[][], double[][]> extractData(Dataset<Regressor> data, ImmutableOutputInfo<Regressor> outputInfo, ImmutableFeatureMap featureMap) Extracts the features andOutputs in LibLinear's format.voidUsed by the OLCUT configuration system, and should not be called by external code.protected List<libsvm.svm_model> trainModels(libsvm.svm_parameter curParams, int numFeatures, libsvm.svm_node[][] features, double[][] outputs) Train all the liblinear instances necessary for this dataset.Methods inherited from class org.tribuo.common.libsvm.LibSVMTrainer
exampleToNodes, getInvocationCount, getProvenance, setupParameters, toString, train, train
-
Constructor Details
-
LibSVMRegressionTrainer
protected LibSVMRegressionTrainer()For olcut. -
LibSVMRegressionTrainer
-
-
Method Details
-
postConfig
Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
postConfigin interfacecom.oracle.labs.mlrg.olcut.config.Configurable- Overrides:
postConfigin classLibSVMTrainer<Regressor>
-
createModel
protected LibSVMModel<Regressor> createModel(ModelProvenance provenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Regressor> outputIDInfo, List<libsvm.svm_model> models) Description copied from class:LibSVMTrainerConstruct the appropriate subtype of LibSVMModel for the prediction task.- Specified by:
createModelin classLibSVMTrainer<Regressor>- Parameters:
provenance- The model provenance.featureIDMap- The feature id map.outputIDInfo- The output id info.models- The svm models.- Returns:
- An implementation of LibSVMModel.
-
trainModels
protected List<libsvm.svm_model> trainModels(libsvm.svm_parameter curParams, int numFeatures, libsvm.svm_node[][] features, double[][] outputs) Description copied from class:LibSVMTrainerTrain all the liblinear instances necessary for this dataset.- Specified by:
trainModelsin classLibSVMTrainer<Regressor>- Parameters:
curParams- The LibLinear parameters.numFeatures- The number of features in this dataset.features- The features themselves.outputs- The outputs.- Returns:
- A list of liblinear models.
-
extractData
protected com.oracle.labs.mlrg.olcut.util.Pair<libsvm.svm_node[][], double[][]> extractData(Dataset<Regressor> data, ImmutableOutputInfo<Regressor> outputInfo, ImmutableFeatureMap featureMap) Description copied from class:LibSVMTrainerExtracts the features andOutputs in LibLinear's format.- Specified by:
extractDatain classLibSVMTrainer<Regressor>- Parameters:
data- The input data.outputInfo- The output info.featureMap- The feature info.- Returns:
- The features and outputs.
-