Support Vector Constraint
Module for formulating a sklearn.svm.SVR,
sklearn.svm.SVC,
sklearn.svm.LinearSVR, or
sklearn.svm.LinearSVC into a PySCIPOpt Model.
- pyscipopt_ml.sklearn.add_support_vector_regressor_constr(scip_model, support_vector_regressor, input_vars, output_vars=None, unique_naming_prefix='', **kwargs)
Formulate support_vector_regressor in scip_model.
The formulation predicts the values of output_vars using input_vars according to support_vector_regressor.
- Parameters:
scip_model (PySCIPOpt Model) – The SCIP model where the predictor should be inserted.
support_vector_regressor (
sklearn.svm.SVR) – The support vector regressor to insert as predictor.input_vars (list or np.ndarray) – Decision variables used as input for support vector in model.
output_vars (list or np.ndarray, optional) – Decision variables used as output for support vector in model.
unique_naming_prefix (str, optional) – A unique naming prefix that is used before all variable and constraint names. This parameter is important if the SCIP model is later printed to file and many predictors are added to the same SCIP model.
- Returns:
Object containing information about what was added to scip_model to formulate support_vector_regressor.
- Return type:
Note
See
add_predictor_constrfor acceptable values for input_vars and output_vars
- pyscipopt_ml.sklearn.add_support_vector_classifier_constr(scip_model, support_vector_classifier, input_vars, output_vars=None, unique_naming_prefix='', **kwargs)
Formulate support_vector_classifier in scip_model.
The formulation predicts the values of output_vars using input_vars according to support_vector_classifier.
- Parameters:
scip_model (PySCIPOpt Model) – The SCIP model where the predictor should be inserted.
support_vector_classifier (
sklearn.svm.SVC) – The support vector classifier to insert as predictor.input_vars (list or np.ndarray) – Decision variables used as input for support vector in model.
output_vars (list or np.ndarray, optional) – Decision variables used as output for support vector in model.
unique_naming_prefix (str, optional) – A unique naming prefix that is used before all variable and constraint names. This parameter is important if the SCIP model is later printed to file and many predictors are added to the same SCIP model.
- Returns:
Object containing information about what was added to scip_model to formulate support_vector_classifier.
- Return type:
Note
See
add_predictor_constrfor acceptable values for input_vars and output_vars
- class pyscipopt_ml.sklearn.support_vector.SupportVectorConstr(scip_model, predictor, input_vars, output_vars, unique_naming_prefix, classification, **kwargs)
Class to model trained
sklearn.svm.SVR,sklearn.svm.SVC,sklearn.svm.LinearSVR, orsklearn.svm.LinearSVCwith SCIPStores the changes to the SCIP Model for representing an instance into it. Inherits from
AbstractPredictorConstr..