SVMException

The SVMException exception is thrown by the SVM::train() method. It happens when the model could not be trained. More generally, SVMException is the error class used throughout the svm extension, which provides PHP bindings to the libsvm library for support vector machine classification and regression. It can also be thrown by other methods, such as SVM::crossvalidate(), SVMModel::load(), or SVMModel::save(), typically because of malformed training data, invalid kernel or cost parameters, or file I/O failures.

<?php

    $svm = new SVM();
    try {
        $model = $svm->train($data);
    } catch (SVMException $e) {
        print $e->getMessage();
    }

?>

Documentation

See also Machine Learning with PHP: using Support Vector Machine (SVM) via ext-svm.

Related : Exception, Support Vector Machine (SVM)