Skip to content

Instantly share code, notes, and snippets.

@diego898
Created November 13, 2022 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diego898/43255549485fa581ff3daad27175ae6d to your computer and use it in GitHub Desktop.
Save diego898/43255549485fa581ff3daad27175ae6d to your computer and use it in GitHub Desktop.
from sklearn import svm, datasets
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import confusion_matrix, classification_report, RocCurveDisplay, ConfusionMatrixDisplay, auc
# Import some data to play with
iris = datasets.load_iris()
X = iris.data
y = iris.target
target_names = iris.target_names[:2]
X, y = X[y != 2], y[y != 2]
n_samples, n_features = X.shape
# Add 'noisy' features to make problem harder
noise_val = 15
X += np.random.random(X.shape)*noise_val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment