Skip to content

Visualization

groot.visualization

plot_adversary(X, y, adversary, ax=None)

Plot the decision tree and samples for a 2D dataset using the adversary. Uses matplotlib.

Parameters:

Name Type Description Default
X array-like of shape (n_samples, n_features)

Feature values.

required
y array-like of shape (n_samples,)

Class labels as integers 0 and 1.

required
adversary groot.adversary.DecisionTreeAdversary

Adversary for this decision tree.

required
ax matplotlib.axes.Axes

Axes object to plot on.

None

plot_estimator(X, y, estimator, ax=None, steps=100, colors=('b', 'r'))

Plot a scikit-learn estimator and samples for a 2D dataset. Uses matplotlib.

Parameters:

Name Type Description Default
X array-like of shape (n_samples, n_features)

Feature values.

required
y array-like of shape (n_samples,)

Ground truth targets.

required
estimator Scikit-learn compatible estimator

Estimator to visualize

required
ax matplotlib.axes.Axes

Axes object to plot on.

None