Stuctured SVM solver for latent-variable models.
Alternates between doing latent variale completion and solving the completed SSVM problem using the base_ssvm solver.
The model is expected to know how to initialize itself - it should provide a init_latent procedure.
If the base_ssvm is an n-slack SSVM, the current constraints will be adjusted after recomputing the latent variables H. If the base_ssvm is a 1-slack SSVM, the inference cache will be reused. Both methods drastically speed up learning.
| Parameters : | base_ssvm : object
latent_iter : int (default=5)
logger : object
|
|---|
Attributes
| w |
Methods
| fit(X, Y[, H_init]) | |
| get_params([deep]) | Get parameters for the estimator |
| predict(X) | |
| predict_latent(X) | |
| score(X, Y) | Compute score as 1 - loss over whole data set. |
| set_params(**params) | Set the parameters of the estimator. |
Get parameters for the estimator
| Parameters : | deep: boolean, optional :
|
|---|---|
| Returns : | params : mapping of string to any
|
Compute score as 1 - loss over whole data set.
Returns the average accuracy (in terms of model.loss) over X and Y.
| Parameters : | X : iterable
Y : iterable
|
|---|---|
| Returns : | score : float
|
Set the parameters of the estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The former have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.
| Returns : | self : |
|---|