<jupyter_start><jupyter_text>Starting  !!  Part 02-Module 01-Lesson 01_Training and Testing Models/05. NumPy Arrays  !!<jupyter_code>import pandas as pd
import numpy as np

data = pd.read_csv("data/dataForNumpy.csv")

print(data)
X = np.array(data[['x1', 'x2']])
print(X)
Y = np.array(data['y'])<jupyter_output>[[ 0.78051   -0.063669 ]
 [ 0.28774    0.29139  ]
 [ 0.40714    0.17878  ]
 [ 0.2923     0.4217   ]
 [ 0.50922    0.35256  ]
 [ 0.27785    0.10802  ]
 [ 0.27527    0.33223  ]
 [ 0.43999    0.31245  ]
 [ 0.33557    0.42984  ]
 [ 0.23448    0.24986  ]
 [ 0.0084492  0.13658  ]
 [ 0.12419    0.33595  ]
 [ 0.25644    0.42624  ]
 [ 0.4591     0.40426  ]
 [ 0.44547    0.45117  ]
 [ 0.42218    0.20118  ]
 [ 0.49563    0.21445  ]
 [ 0.30848    0.24306  ]
 [ 0.39707    0.44438  ]
 [ 0.32945    0.39217  ]
 [ 0.40739    0.40271  ]
 [ 0.3106     0.50702  ]
 [ 0.49638    0.45384  ]
 [ 0.10073    0.32053  ]
 [ 0.69907    0.37307  ]
 [ 0.29767    0.69648  ]
 [ 0.15099    0.57341  ]
 [ 0.16427    0.27759  ]
 [ 0.33259    0.055964 ]
 [ 0.53741    0.28637  ]
 [ 0.19503    0.36879  ]
 [ 0.40278    0.035148 ]
 [ 0.21296    0.55169  ]
 [ 0.48447    0.56991  ]
 [ 0.25476    0.34596  ]
 [ 0.21726    0.28641  ]
 [ 0.67078    0.46538  ]
 [ 0.3815     0.4622   ]
 [ 0.53838    0.32774  ]
 [ 0.4849     0.26071  ]
[...]<jupyter_text>!!  Part 02-Module 01-Lesson 01_Training and Testing Models/06. Training models in sklearn  !! In the last section, we learned most of the most important classification algorithms in Machine Learning, including the following:Logistic RegressionNeural NetworksDecision TreesSupport Vector Machines<jupyter_code>import matplotlib.pyplot as plt

fig, (ax1, ax2) = plt.subplots(1, 2)

fig.suptitle("Data of Points")

ax1.plot(X, 'r+');

ax2.plot(Y, 'b.');<jupyter_output><empty_output><jupyter_text>Fit Model  Classifier With Scikit Learn 1. Logistic Regression<jupyter_code>from sklearn.linear_model import LogisticRegression

classifierLR = LogisticRegression()

classifierLR.fit(X, Y)<jupyter_output><empty_output><jupyter_text>Logistic testing<jupyter_code>xtest = [[ 0.9, .7 ]]
print(classifierLR.predict(xtest))<jupyter_output>[1]<jupyter_text>2. Neural Networks<jupyter_code>from sklearn.neural_network import MLPClassifier

classifierNN = MLPClassifier()<jupyter_output><empty_output><jupyter_text>3. Decision Trees<jupyter_code>from sklearn.tree import DecisionTreeClassifiere

classifierDT = DecisionTreeClassifiere()<jupyter_output><empty_output><jupyter_text>4. Support Vector Machines<jupyter_code>from sklearn.svm import SVC

classifierSV = SVC()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup