Skip to content

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

License

Notifications You must be signed in to change notification settings

hxt365/Deciplot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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=(10, 10))

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

Decision boundary plot

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages