diff --git a/3217-classification-lr-example1.py b/3217-classification-lr-example1.py deleted file mode 100644 index 2e52436c3f817deed0347943c3859e055ddb9370..0000000000000000000000000000000000000000 --- 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()