class DocWeightedSpans(document, spans, preserve_density=None, vec_name=None)[source]

Features highlighted in text. :document: is a pre-processed document before applying the analyzer. :weighted_spans: holds a list of spans for features found in text (span indices correspond to :document:). :preserve_density: determines how features are colored when doing formatting - it is better set to True for char features and to False for word features.

class Explanation(estimator, description=None, error=None, method=None, is_regression=False, targets=None, feature_importances=None, decision_tree=None, highlight_spaces=None, transition_features=None)[source]

An explanation for classifier or regressor, it can either explain weights or a single prediction.

class FeatureImportances(importances, remaining)[source]

Feature importances with number of remaining non-zero features.

class FeatureWeights(pos, neg, pos_remaining=0, neg_remaining=0)[source]

Weights for top features, :pos: for positive and :neg: for negative, sorted by descending absolute value. Number of remaining positive and negative features are stored in :pos_remaining: and :neg_remaining: attributes.

class NodeInfo(id, is_leaf, value, value_ratio, impurity, samples, sample_ratio, feature_name=None, feature_id=None, threshold=None, left=None, right=None)[source]

A node in a binary tree. Pointers to left and right children are in :left: and :right: attributes.

class TargetExplanation(target, feature_weights, proba=None, score=None, weighted_spans=None)[source]

Explanation for a single target or class. Feature weights are stored in the :feature_weights: attribute, and features highlighted in text in the :weighted_spans: attribute.

class TransitionFeatureWeights(class_names, coef)[source]

Weights matrix for transition features.

class TreeInfo(criterion, tree, graphviz, is_classification)[source]

Information about the decision tree. :criterion: is the name of the function to measure the quality of a split, :tree: holds all nodes of the tree, and :graphviz: is the tree rendered in graphviz .dot format.

class WeightedSpans(docs_weighted_spans, other=None)[source]

Holds highlighted spans for parts of document - a DocWeightedSpans object for each vectorizer, and other features not highlighted anywhere.