Skip to content

Commit

Permalink
implementing simple perceptron
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSomen committed Sep 2, 2018
1 parent 4105c24 commit 6d12cdf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions AAN/arti_neural_net.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#%%
import numpy as np
from sklearn.datasets import load_iris
from sklearn.linear_model import Perceptron

iris = load_iris()
X = iris.data[:, (2, 3)] # petal length, petal width
Y = (iris.target == 0).astype(np.int) # Iris Setosa?

per_clf = Perceptron()
per_clf.fit(X,Y)

y_pred = per_clf.predict([[2,0.5]])
print(y_pred)

0 comments on commit 6d12cdf

Please sign in to comment.