lale.lib.sklearn.svc module¶
- class lale.lib.sklearn.svc.SVC(*, C=1.0, kernel='rbf', degree=3, gamma='scale', coef0=0.0, shrinking=True, probability=False, tol=0.001, cache_size=200, class_weight=None, verbose=False, max_iter=-1, decision_function_shape='ovr', random_state=None, break_ties=False)¶
Bases:
PlannedIndividualOp
Support Vector Classification from scikit-learn.
This documentation is auto-generated from JSON schemas.
- Parameters
C (float, >0.0, >=0.03125 for optimizer, <=32768 for optimizer, loguniform distribution, optional, not for optimizer, default 1.0) – Penalty parameter C of the error term.
kernel (union type, default 'rbf') –
Specifies the kernel type to be used in the algorithm.
’precomputed’, not for optimizer
or ‘linear’, ‘poly’, ‘rbf’, or ‘sigmoid’
or callable, not for optimizer
See also constraint-1.
degree (integer, >=0, >=2 for optimizer, <=5 for optimizer, default 3) – Degree of the polynomial kernel function (‘poly’).
gamma (union type, default 'scale') –
Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’.
’scale’ or ‘auto’
or float, >0.0, >=3.0517578125e-05 for optimizer, <=8 for optimizer, loguniform distribution
coef0 (float, >=-1 for optimizer, <=1 for optimizer, optional, not for optimizer, default 0.0) – Independent term in kernel function.
shrinking (boolean, default True) – Whether to use the shrinking heuristic.
probability (boolean, optional, default False) – Whether to enable probability estimates.
tol (float, >0.0, <=0.01 for optimizer, default 0.001) – Tolerance for stopping criteria.
cache_size (integer, >=0, <=1000 for optimizer, not for optimizer, default 200) – Specify the size of the kernel cache (in MB).
class_weight (union type, optional, not for optimizer, default None) –
None
By default, all classes have weight 1.
or ‘balanced’
Adjust weights by inverse frequency.
or dict, not for optimizer
Dictionary mapping class labels to weights.
verbose (boolean, optional, not for optimizer, default False) – Enable verbose output.
max_iter (integer, >=1 for optimizer, <=1000 for optimizer, not for optimizer, default -1) – Hard limit on iterations within solver, or -1 for no limit.
decision_function_shape (‘ovo’ or ‘ovr’, not for optimizer, default ‘ovr’) – Whether to return a one-vs-rest (‘ovr’) decision function of shape (n_samples, n_classes) as all other classifiers, or the original one-vs-one (‘ovo’) decision function of libsvm which has shape (n_samples, n_classes * (n_classes - 1) / 2).
random_state (union type, optional, not for optimizer, default None) –
Seed of pseudo-random number generator.
numpy.random.RandomState
or None
RandomState used by np.random
or integer
Explicit seed.
break_ties (boolean, optional, not for optimizer, default False) – If true, decision_function_shape=’ovr’, and number of classes > 2, predict will break ties according to the confidence values of decision_function; otherwise the first class among the tied classes is returned.
Notes
constraint-1 : union type
Sparse precomputed kernels are not supported.
negated type of ‘X/isSparse’
or kernel : negated type of ‘precomputed’
- 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) –
The outer array is over samples aka rows.
items : array of items : float
The inner array is over features aka columns.
- Returns
result – Confidence scores for samples for each class in the model.
array of items : array of items : float
In the multi-way case, score per (sample, class) combination.
or array of items : float
In the binary case, score for self._classes[1].
- Return type
union type
- 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 predicted classes.
array of items : float
or array of items : string
or array of items : boolean
sample_weight (union type, optional) –
Sample weights.
array of items : float
or None
Samples are equally weighted.
- 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, optional) –
The outer array is over samples aka rows.
items : array of items : float
The inner array is over features aka columns.
- Returns
result – The predicted classes.
array of items : float
or array of items : string
or array of items : boolean
- Return type
union type
- predict_proba(X)¶
Probability estimates for all classes.
Note: The predict_proba 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.
- Returns
result – The outer array is over samples aka rows.
items : array of items : float
The inner array has items corresponding to each class.
- Return type
array