To install this repo as Python lib just run the following command:
pip install git+https://github.com/VolodymyrVozniak/feature-visualizer
scikit-learn>=1.2.0
pandas>=1.5.2
plotly>=5.7.0
- For binary problem check this tutorial
- For regression problem check this tutorial
- For multiclassification problem check this tutorial
There is 1 main class for feature visualization:
Visualizer
- to visualize features for binary, regression and multiclassification problems
- Binary problem
from sklearn.datasets import load_breast_cancer
from croatoan_visualizer.visualizer import Visualizer
X, y = load_breast_cancer(return_X_y=True, as_frame=True)
df = X.assign(target=y)
vis = Visualizer(
df=df.reset_index(),
id_column="index",
target_column="target"
)
vis.pca2d()
vis.pca3d()
vis.tsne2d()
vis.tsne3d()
For more details check tutorial
- Regression problem
from sklearn.datasets import load_diabetes
from croatoan_visualizer.visualizer import Visualizer
X, y = load_diabetes(return_X_y=True, as_frame=True)
df = X.assign(target=y)
df["target"] = pd.qcut(df["target"], 10, labels=False, duplicates='drop')
vis = Visualizer(
df=df.reset_index(),
id_column="index",
target_column="target"
)
vis.pca2d()
vis.pca3d()
vis.tsne2d()
vis.tsne3d()
For more details check tutorial
- Multiclassification problem
from sklearn.datasets import load_iris
from croatoan_visualizer.visualizer import Visualizer
X, y = load_iris(return_X_y=True, as_frame=True)
df = X.assign(target=y)
vis = Visualizer(
df=df.reset_index(),
id_column="index",
target_column="target"
)
vis.pca2d()
vis.pca3d()
vis.tsne2d()
vis.tsne3d()
For more details check tutorial