# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

from sklearn.datasets import load_iris
import pandas as pd
iris = load_iris()
df = pd.DataFrame(iris["data"], columns = iris["feature_names"])
df["target"] = iris["target"]
df

less_df = df.drop(["petal width (cm)", "sepal width (cm)"], axis = 1)
less_df_x = less_df.drop(["target"], axis =1)
less_df


from sklearn.linear_model import Perceptron
clf = Perceptron()
clf.fit(less_df_x, less_df["target"])

from mlxtend.plotting import plot_decision_regions
import numpy as np
# %matplotlib inline
plot_decision_regions(X = np.array(less_df_x), y = np.array(less_df["target"]), clf = clf)



StarcoderdataJupyterScriptsDedupFiltered