lale.lib.sklearn.passive_aggressive_classifier module¶
- class lale.lib.sklearn.passive_aggressive_classifier.PassiveAggressiveClassifier(*, C=1.0, fit_intercept=False, max_iter=1000, tol=None, early_stopping=False, validation_fraction=0.1, n_iter_no_change=5, shuffle=True, verbose=0, loss='hinge', n_jobs=None, random_state=None, warm_start=False, class_weight=None, average=False)¶
Bases:
PlannedIndividualOp
Passive aggressive classifier from scikit-learn.
This documentation is auto-generated from JSON schemas.
- Parameters
C (float, >=1e-05 for optimizer, <=10 for optimizer, loguniform distribution, default 1.0) – Maximum step size (regularization). Defaults to 1.0.
fit_intercept (boolean, default False) – Whether the intercept should be estimated or not. If False, thethe data is assumed to be already centered.
max_iter (integer, >=5 for optimizer, <=1000 for optimizer, uniform distribution, default 1000) – The maximum number of passes over the training data (aka epochs).
tol (union type, default None) –
The stopping criterion. If it is not None, the iterations will stop
float, >=1e-08 for optimizer, <=0.01 for optimizer
or None
early_stopping (boolean, default False) – Whether to use early stopping to terminate training when validation.
validation_fraction (float, >=0, <=1, optional, not for optimizer, default 0.1) – The proportion of training data to set aside as validation set for early stopping.
n_iter_no_change (integer, >=5 for optimizer, <=10 for optimizer, optional, not for optimizer, default 5) – Number of iterations with no improvement to wait before early stopping.
shuffle (boolean, default True) – Whether or not the training data should be shuffled after each epoch.
verbose (union type, optional, not for optimizer, default 0) –
The verbosity level
integer
or None
loss (‘hinge’ or ‘squared_hinge’, default ‘hinge’) – The loss function to be used:
n_jobs (union type, optional, not for optimizer, default None) –
The number of CPUs to use to do the OVA (One Versus All, for
integer
or None
random_state (union type, optional, not for optimizer, default None) –
The seed of the pseudo random number generator to use when shuffling
integer
or numpy.random.RandomState
or None
warm_start (boolean, optional, not for optimizer, default False) – When set to True, reuse the solution of the previous call to fit as initialization, otherwise, just erase the previous solution.
class_weight (union type, optional, not for optimizer, default None) –
Preset for the class_weight fit parameter.
dict
or ‘balanced’ or None
average (union type, default False) –
When set to True, computes the averaged SGD weights and stores the result in the
coef_
attribute.boolean
or integer, not for optimizer
- 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 of items : array of items : float) –
- 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 of items : array of items : float) –
y (union type) –
array of items : string
or array of items : float
or array of items : boolean
coef_init (array, optional of items : array of items : float) – The initial coefficients to warm-start the optimization.
intercept_init (array, optional of items : float) – The initial intercept to warm-start the optimization.
- partial_fit(X, y=None, **fit_params)¶
Incremental fit to train train the operator on a batch of samples.
Note: The partial_fit method is not available until this operator is trainable.
Once this method is available, it will have the following signature:
- Parameters
X (array of items : array of items : float) –
y (union type) –
array of items : string
or array of items : float
or array of items : boolean
classes (union type, optional) –
array of items : string
or array of items : float
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 of items : array of items : float) –
- Returns
result –
array of items : string
or array of items : float
or array of items : boolean
- Return type
union type