APLRClassifier#

Link to Algorithm description: Automatic Piecewise Linear Regression

The below API reference explains the methods added by the light wrapper in InterpretML. The API reference for the remaining members and methods can be found here.

class interpret.glassbox.APLRClassifier(**kwargs)#

Initializes class.

Parameters:

**kwargs – Kwargs pass to APLRClassifier at initialization time.

explain_global(name=None)#

Provides global explanation for model.

Parameters:

name – User-defined explanation name.

Returns:

An explanation object, visualizing feature-value pairs as horizontal bar chart.

explain_local(X, y=None, name=None)#

Provides local explanations for provided instances.

Parameters:
  • X – Numpy array for X to explain.

  • y – Numpy vector for y to explain.

  • name – User-defined explanation name.

Returns:

An explanation object, visualizing feature-value pairs for each instance as horizontal bar charts.

score(X, y, sample_weight=None)#

Return the mean accuracy on the given test data and labels.

In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Test samples.

  • y (array-like of shape (n_samples,) or (n_samples, n_outputs)) – True labels for X.

  • sample_weight (array-like of shape (n_samples,), default=None) – Sample weights.

Returns:

score – Mean accuracy of self.predict(X) w.r.t. y.

Return type:

float