Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 1.82 KB

dispersion.rst

File metadata and controls

70 lines (47 loc) · 1.82 KB

MissingValues Dispersion

The MissingValues Dispersion visualizer creates a chart that maps the position of missing values by the order of the index.

Without Targets Supplied

import numpy as np

from sklearn.datasets import make_classification from yellowbrick.contrib.missing import MissingValuesDispersion

X, y = make_classification(

n_samples=400, n_features=10, n_informative=2, n_redundant=3, n_classes=2, n_clusters_per_class=2, random_state=854

)

# assign some NaN values X[X > 1.5] = np.nan features = ["Feature {}".format(str(n)) for n in range(10)]

visualizer = MissingValuesDispersion(features=features)

visualizer.fit(X) visualizer.show()

With Targets (y) Supplied

import numpy as np

from sklearn.datasets import make_classification from yellowbrick.contrib.missing import MissingValuesDispersion

X, y = make_classification(

n_samples=400, n_features=10, n_informative=2, n_redundant=3, n_classes=2, n_clusters_per_class=2, random_state=854

)

# assign some NaN values X[X > 1.5] = np.nan features = ["Feature {}".format(str(n)) for n in range(10)]

# Instantiate the visualizer visualizer = MissingValuesDispersion(features=features)

visualizer.fit(X, y=y) # supply the targets via y visualizer.show()

API Reference

yellowbrick.contrib.missing.dispersion