lale.lib.snapml.snap_svm_classifier module¶
- class lale.lib.snapml.snap_svm_classifier.SnapSVMClassifier(*, max_iter=100, regularizer=1.0, use_gpu=False, device_ids=None, class_weight=None, verbose=False, n_jobs=1, tol=0.001, generate_training_history=None, fit_intercept=True, intercept_scaling=1.0, normalize=True, kernel='rbf', gamma=1.0, n_components=100, random_state=None)¶
Bases:
PlannedIndividualOp
Support Vector Machine from Snap ML.
This documentation is auto-generated from JSON schemas.
- Parameters
max_iter (integer, >=1, >=10 for optimizer, <=1000 for optimizer, optional, default 100) – Maximum number of iterations used by the solver to converge.
regularizer (float, >0.0, >=1.0 for optimizer, <=100.0 for optimizer, uniform distribution, optional, default 1.0) – Larger regularization values imply stronger regularization.
use_gpu (boolean, optional, not for optimizer, default False) – Use GPU Acceleration.
device_ids (union type, optional, not for optimizer, default None) –
Device IDs of the GPUs which will be used when GPU acceleration is enabled.
None
Use [0].
or array of items : integer
class_weight (‘balanced’ or None, optional, not for optimizer, default None) – If set to ‘balanced’ samples weights will be applied to account for class imbalance, otherwise no sample weights will be used.
verbose (boolean, optional, not for optimizer, default False) – If True, it prints the training cost, one per iteration. Warning: this will increase the training time. For performance evaluation, use verbose=False.
n_jobs (integer, >=1, optional, not for optimizer, default 1) – The number of threads used for running the training. The value of this parameter should be a multiple of 32 if the training is performed on GPU (use_gpu=True).
tol (float, >0.0, optional, not for optimizer, default 0.001) – The tolerance parameter. Training will finish when maximum change in model coefficients is less than tol.
generate_training_history (‘summary’, ‘full’, or None, optional, not for optimizer, default None) – Determines the level of summary statistics that are generated during training.
fit_intercept (boolean, optional, default True) – Add bias term – note, may affect speed of convergence, especially for sparse datasets.
intercept_scaling (float, >0.0, optional, not for optimizer, default 1.0) – Scaling of bias term. The inclusion of a bias term is implemented by appending an additional feature to the dataset. This feature has a constant value, that can be set using this parameter.
normalize (boolean, optional, not for optimizer, default True) – Normalize rows of dataset (recommended for fast convergence).
kernel (‘rbf’ or ‘linear’, optional, default ‘rbf’) – Approximate feature map of a specified kernel function.
gamma (float, >0.0, >=0.01 for optimizer, <=100.0 for optimizer, uniform distribution, optional, default 1.0) – Parameter of RBF kernel: exp(-gamma * x^2).
n_components (integer, >=1, >=10 for optimizer, <=200 for optimizer, optional, default 100) – Dimensionality of the feature space when approximating a kernel function.
random_state (union type, optional, not for optimizer, default None) –
Seed of pseudo-random number generator.
None
RandomState used by np.random
or integer
Explicit seed.
- decision_function(X)¶
Confidence scores for all classes.
Note: The decision_function method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array, optional) –
The outer array is over samples aka rows.
items : array of items : float
The inner array is over features aka columns.
n_jobs (integer, >=0, optional, default 0) – Number of threads used to run inference. By default inference runs with maximum number of available threads.
- Returns
result – The outer array is over samples aka rows.
items : array of items : float
The inner array contains confidence scores corresponding to each class.
- Return type
array
- fit(X, y=None, **fit_params)¶
Train the operator.
Note: The fit method is not available until this operator is trainable.
Once this method is available, it will have the following signature:
- Parameters
X (array) –
The outer array is over samples aka rows.
items : array of items : float
The inner array is over features aka columns.
y (union type) –
The classes.
array of items : float
or array of items : string
or array of items : boolean
- predict(X, **predict_params)¶
Make predictions.
Note: The predict method is not available until this operator is trained.
Once this method is available, it will have the following signature:
- Parameters
X (array) –
The outer array is over samples aka rows.
items : array of items : float
The inner array is over features aka columns.
n_jobs (integer, >=0, optional, default 0) – Number of threads used to run inference. By default inference runs with maximum number of available threads.
- Returns
result – The predicted classes.
array of items : float
or array of items : string
or array of items : boolean
- Return type
union type