Classifier Plots

Relevant Imports

In [1]:
from sklearn import svm
from sklearn.datasets import load_iris, load_breast_cancer

import sys

if '../' not in sys.path:
    sys.path.append('../')

Binary Labled Data - Breast Cancer Dataset

In [2]:
breast_cancer = load_breast_cancer()

breast_cancer_clf = svm.SVC(kernel='rbf',probability=True)
breast_cancer_clf.fit(breast_cancer.data[:, :3],breast_cancer.target);

Multiclass Labled Data - Iris Dataset

In [3]:
iris = load_iris()

iris_clf = svm.SVC(kernel='rbf',probability=True)
iris_clf.fit(iris.data[:,:2], iris.target);

Two Dimensional Classifier

In [4]:
from palantiri.ClassifierPlotHandlers import TwoDimensionalClassifierPlotHandler

plot_handler = TwoDimensionalClassifierPlotHandler(iris, iris_clf)
In [5]:
plot_handler.plot_prediction()
In [6]:
plot_handler.plot_roc()