pyconstruct.learners.StructuredPerceptron

class pyconstruct.learners.StructuredPerceptron(domain=None, model=None, **kwargs)

A simple structured perceptron algorithm from [1].

Parameters:domain (BaseDomain) – The domain of the data.

References

[1]Collins, Michael. “Discriminative training methods for hidden markov models: Theory and experiments with perceptron algorithms.” EMNLP (2002).

Methods

decision_function(X, Y, **kwargs)
fit(X, Y, **kwargs) Fit a model with data (X, Y).
get_params([deep]) Get parameters for this estimator.
loss(X, Y, Y_pred, **kwargs)
partial_fit(X, Y[, Y_pred, Y_phi, Y_pred_phi]) Updates the current model with a mini-batch (X, Y).
phi(X, Y, **kwargs) Computes the feature vector for the given input and output objects.
predict(X, *args, **kwargs) Computes the prediction of the current model for the given input.
score(X, Y[, Y_pred]) Compute the score as the average loss over the examples.
set_params(**params) Set the parameters of this estimator.