From 136a839950324ce73a192af1c2b39ad5492b149c Mon Sep 17 00:00:00 2001 From: Chauhan Chauhan <j.chauhan@soton.ac.uk> Date: Sun, 23 Apr 2023 18:43:40 +0000 Subject: [PATCH] Delete 3217-classification-lr-example1.py --- 3217-classification-lr-example1.py | 43 ------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 3217-classification-lr-example1.py diff --git a/3217-classification-lr-example1.py b/3217-classification-lr-example1.py deleted file mode 100644 index 2e52436..0000000 --- a/3217-classification-lr-example1.py +++ /dev/null @@ -1,43 +0,0 @@ -#Taken from Scikit - -import matplotlib.pyplot as plt -from sklearn.linear_model import LogisticRegression -from sklearn import datasets -from sklearn.inspection import DecisionBoundaryDisplay - -# import some data from a predefined datatset -iris = datasets.load_iris() -X = iris.data[:, :2] # we only take the first two features. -Y = iris.target -#print shape of the array for X and Y. Also get value of targets -print (X.shape) -print (Y) -print (Y.shape) - - -# Create an instance of Logistic Regression Classifier and fit the data. -logreg = LogisticRegression(C=1) -logreg.fit(X, Y) - -_, ax = plt.subplots(figsize=(4, 3)) -DecisionBoundaryDisplay.from_estimator( - logreg, - X, - cmap=plt.cm.Paired, - ax=ax, - response_method="auto", - plot_method="pcolormesh", - shading="auto", - xlabel="Sepal length", - ylabel="Sepal width", - eps=0.5, -) - -# Plot the training points -plt.scatter(X[:, 0], X[:, 1], c=Y, edgecolors="k", cmap=plt.cm.Paired) - - -plt.xticks(()) -plt.yticks(()) - -plt.show() -- GitLab