The standard way of computing SVM using AOCL-DA is as follows.
The following description relates to SVC but analogous steps can be applied to other SVM models.
Initialize a
aoclda.svm.SVC()object with options set in the class constructor.Compute SVM on your data using
aoclda.svm.SVC.fit().Call
aoclda.svm.SVC.predict()to evaluate the model on new data.Extract results from the
aoclda.svm.SVC()object via its class attributes.
Initialize a
da_handlewithda_handle_typeda_handle_svm.Select the SVM model
da_svm_modelwith da_svm_select_model_?.Pass data to the handle using da_svm_set_data_?.
Customize the model using da_options_set_? (see below for a list of the available options).
Compute the SVM using da_svm_compute_?.
Evaluate the model on new data using da_svm_predict_?.
Extract results using da_handle_get_result_?. The following results are available:
Total number of support vectors (
da_svm_n_support_vectors), \((n_{\mathrm{support\_vectors}},\,)\). Integer.Number of support vectors per class (
da_svm_n_support_vectors_per_class). Vector of size \((n_{\mathrm{class}},\,)\).Support vectors (
da_svm_support_vectors): The subset of training samples that lie on or within the margin. Matrix of size \((n_{\mathrm{support\_vectors}},\, n_{\mathrm{features}})\).Bias (intercept) (
da_svm_bias): The bias term in the decision function. Vector of size \((n_{\mathrm{class}}-1,\,)\).Dual coefficients (
da_svm_dual_coef): \(\alpha\) in the dual problem. Weights assigned to each support vector, reflecting their importance in defining the optimal decision boundary. Matrix of size \((n_{\mathrm{support\_vectors}},\, n_{\mathrm{class}}-1)\).Indexes to support vectors (
da_svm_idx_support_vectors). Vector of size \((n_{\mathrm{support\_vectors}},\,)\).Number of iterations (
da_svm_n_iterations). In this context it counts the number of SMO subproblems solved, for each classifier. Vector of size \((n_{\mathrm{classifiers}},\,)\).Some solvers provide extra information.
da_result_::da_rinfo, when available, contains the info[100] array with the following values:info[0]: number of rows in the input matrix,
info[1]: number of columns in the input matrix,
info[2]: number of detected classes, for regression returns 2,
info[3-99]: reserved for future use.