Ex 5 - NN - Wheat Seed Data
Ex 5 - NN - Wheat Seed Data
import pandas as pd
import numpy as np
Out[3]: Type
0 1
1 1
2 1
3 1
4 1
... ...
194 3
195 3
196 3
197 3
198 3
corr = corr.round(2)
corr
fig = px.imshow(corr ,
width = 700,
height = 700 ,
text_auto = True,
color_continuous_scale = 'tealgrn',
)
fig.show()
0.6
0.4
0.2
Kernel.Width 0.97 0.95 0.76 0.86 1 −0.25 0.75 −0.42
0
Asymmetry.Coeff −0.22 −0.21 −0.33 −0.17 −0.25 1 0 0.57
Ar Pe Co Ke Ke As Ke Ty
ea rim mp rne rne ym rne pe
ete ac l.L l.W me l.G
r tne en idt try roo
ss gth h . Co ve
e ff
It can be observed that the attribute "Kernel.Groove" has very least correlation on the
target variable
Install scikit-neuralnetwork
In [1]: #scikit-neuralnetwork works withscikit-learn 0.18 and above
Processing c:\users\gurram\appdata\local\pip\cache\wheels\7d\42\93\b99bd6392fb56ec7831a6
95cb7a23dd9c73382b258614b62ed\scikit_neuralnetwork-0.7-py3-none-any.whl
Processing c:\users\gurram\appdata\local\pip\cache\wheels\a3\72\b6\89bbeb6140ee3756fa2bd
d2fb03003dd60d289851314b35fd7\lasagne-0.1-py3-none-any.whl
Processing c:\users\gurram\appdata\local\pip\cache\wheels\26\68\6f\745330367ce7822fe0cd8
63712858151f5723a0a5e322cc144\theano-1.0.5-py3-none-any.whl
Requirement already satisfied: colorama in d:\anaconda\lib\site-packages (from scikit-ne
uralnetwork) (0.4.3)
Requirement already satisfied: scikit-learn>=0.17 in c:\users\gurram\appdata\roaming\pyt
hon\python37\site-packages (from scikit-neuralnetwork) (1.0.2)
Requirement already satisfied: numpy in d:\anaconda\lib\site-packages (from Lasagne>=0.1
->scikit-neuralnetwork) (1.18.1)
Requirement already satisfied: scipy>=0.14 in c:\users\gurram\appdata\roaming\python\pyt
hon37\site-packages (from Theano>=0.8->scikit-neuralnetwork) (1.7.3)
Requirement already satisfied: six>=1.9.0 in d:\anaconda\lib\site-packages (from Theano>
=0.8->scikit-neuralnetwork) (1.14.0)
Requirement already satisfied: joblib>=0.11 in d:\anaconda\lib\site-packages (from sciki
t-learn>=0.17->scikit-neuralnetwork) (0.14.1)
Collecting threadpoolctl>=2.0.0
Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Installing collected packages: Lasagne, Theano, scikit-neuralnetwork, threadpoolctl
Successfully installed Lasagne-0.1 Theano-1.0.5 scikit-neuralnetwork-0.7 threadpoolctl-
3.1.0
pred_test = mlp.predict(X_test)
mlp_accuracy = accuracy_score(y_test, pred_test)
print('% of Accuracy using MultiLayer Perceptron: ', "{0:0.2f}".format(mlp_accuracy*100)