Structural Correspondence Learner¶
-
class
libtlda.scl.StructuralCorrespondenceClassifier(loss='logistic', l2=1.0, num_pivots=1, num_components=1)¶ Class of classifiers based on structural correspondence learning.
Methods consist of a way to augment features, and a Huber loss function plus gradient.
Methods
Huber_grad(theta, X, y[, l2])Huber gradient computation. Huber_loss(theta, X, y[, l2])Huber loss function. augment_features(X, Z[, l2])Find a set of pivot features, train predictors and extract bases. fit(X, y, Z)Fit/train an structural correpondence classifier. get_params()Get classifier parameters. is_trained()Check whether classifier is trained. predict(Z)Make predictions on new dataset. -
Huber_grad(theta, X, y, l2=0.0)¶ Huber gradient computation.
Reference: Ando & Zhang (2005a). A framework for learning predictive structures from multiple tasks and unlabeled data. JMLR.
Parameters: - theta : array
classifier parameters (D features by 1)
- X : array
data (N samples by D features)
- y : array
label vector (N samples by 1)
- l2 : float
l2-regularization parameter (def= 0.0)
Returns: - array
Gradient with respect to classifier parameters
-
Huber_loss(theta, X, y, l2=0.0)¶ Huber loss function.
Reference: Ando & Zhang (2005a). A framework for learning predictive structures from multiple tasks and unlabeled data. JMLR.
Parameters: - theta : array
classifier parameters (D features by 1)
- X : array
data (N samples by D features)
- y : array
label vector (N samples by 1)
- l2 : float
l2-regularization parameter (def= 0.0)
Returns: - array
Objective function value.
-
augment_features(X, Z, l2=0.0)¶ Find a set of pivot features, train predictors and extract bases.
Parameters X : array
source data array (N samples by D features)- Z : array
- target data array (M samples by D features)
- l2 : float
- regularization parameter value (def: 0.0)
Returns: - None
-
fit(X, y, Z)¶ Fit/train an structural correpondence classifier.
Parameters: - X : array
source data (N samples by D features)
- y : array
source labels (N samples by 1)
- Z : array
target data (M samples by D features)
Returns: - None
-
get_params()¶ Get classifier parameters.
-
is_trained()¶ Check whether classifier is trained.
-
predict(Z)¶ Make predictions on new dataset.
Parameters: - Z : array
new data set (M samples by D features)
Returns: - preds : array
label predictions (M samples by 1)
-