Skip to main content

A handy tool that helps you better visualize your data by plotting 2D decision boundaries, using any sklearn classifier models.

Project description

Deciplot

This is a handy tool that helps you better visualize your data by plotting 2D decision boundaries, using any sklearn classifier models.

Installation

Run the following to install:

pip install deciplot

Usage

from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
from deciplot import DeciPlot2D

# Get iris dataset from sklearn
iris = load_iris()
X, y, feature_names, target_names = iris['data'], iris['target'], iris['feature_names'], iris['target_names']

# Initialize a classifier model for plotting decision boundaries
dtree = DecisionTreeClassifier()

# Initialize an DecPlot2D object
dp2d = DeciPlot2D(X, y, feature_names, target_names, dtree)

# Plot and visualize decision boundaries
dp2d.plot(figsize=(20, 10))

After running this code, we'll get this beautiful plot:

Decision boundary plot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deciplot-0.0.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

deciplot-0.0.1-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page