This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plotting ridge classifier python

Hi everyone,

I am training scikit learn a bit. I was trying to do a ridge classifier on breast_cancer dataset. How can I plot the classifier line to show the boundaries?

Here the code I used:

import numpy as np
from sklearn import datasets
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import RidgeClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler

data = datasets.load_breast_cancer(as_frame=True)

X = data.data
X = StandardScaler().fit_transform(X)
y = data.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.4, random_state=42)
clf = RidgeClassifier()
clf.fit(X_train, y_train)
score = clf.score(X_test, y_test)
y_pred = clf.predict(X_test)
sklearn python

Hello RiccPicc!

We believe that this post does not fit the main topic of this site.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.