Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-226
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-226
2022-226
Commits
3ef85942
Commit
3ef85942
authored
May 24, 2022
by
Anuththara K.G.S.N
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Severity_Level_Prediction.py
parent
a26e0ae0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1678 additions
and
427 deletions
+1678
-427
Severity_Level_Prediction/Severity_Level_Prediction.py
Severity_Level_Prediction/Severity_Level_Prediction.py
+1678
-427
No files found.
Severity_Level_Prediction/Severity_Level_Prediction.py
View file @
3ef85942
#!/usr/bin/env python
{
# coding: utf-8
"cells"
:
[
{
# Severity Level Prediction
"cell_type"
:
"markdown"
,
"id"
:
"4d9f2d90"
,
# In[1]:
"metadata"
:
{},
"source"
:
[
"Severity Level Prediction"
#Importing Libraries
]
from
mpl_toolkits.mplot3d
import
Axes3D
},
from
sklearn.preprocessing
import
StandardScaler
{
import
matplotlib.pyplot
as
plt
"cell_type"
:
"code"
,
from
tkinter
import
*
"execution_count"
:
1
,
import
numpy
as
np
"id"
:
"89a28bd8"
,
import
pandas
as
pd
"metadata"
:
{},
import
os
"outputs"
:
[],
"source"
:
[
"#Importing Libraries
\n
"
,
# In[2]:
"from mpl_toolkits.mplot3d import Axes3D
\n
"
,
"from sklearn.preprocessing import StandardScaler
\n
"
,
"import matplotlib.pyplot as plt
\n
"
,
#List of the symptoms is listed here in list l1.
"from tkinter import *
\n
"
,
l1
=
[
'Yeast_Visibility-ears,armpits,_or_paws'
,
'Yeast_Visibility-around_half_of_the_body'
,
'Yeast_Visibility-whole_body'
,
"import numpy as np
\n
"
,
'Redness-pink_or_red_skin'
,
'Redness-red_skin'
,
'Redness-gray_or_black_skin'
,
"import pandas as pd
\n
"
,
'No_unpleasant_Smell'
,
'Musty_smell'
,
'Extreme_musty_smell'
,
"import os"
'No_Itching_and_Scratching'
,
'Itching_and_Scratching-time_to_time'
,
'Itching_and_Scratching-constantly'
,
]
'No_Thickened_Skin'
,
'Thickened_Skin'
,
'Extremely_Thickened_Skin(Elephant_skin_appearance)'
,
},
'No_Hair_Loss'
,
'Starting_Hair_Loss'
,
'Hair_Loss'
,
{
'No_Hearing_Issues'
,
'Hearing_Issues'
,
'Deafness'
]
"cell_type"
:
"code"
,
"execution_count"
:
2
,
"id"
:
"ffa7d78b"
,
# In[3]:
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
#List of Severity Levels.
"#List of the symptoms is listed here in list l1.
\n
"
,
level
=
[
'Primary'
,
'Secondary'
,
'Tertiary'
]
"l1=['Yeast_Visibility-ears,armpits,_or_paws','Yeast_Visibility-around_half_of_the_body','Yeast_Visibility-whole_body',
\n
"
,
" 'Redness-pink_or_red_skin','Redness-red_skin','Redness-gray_or_black_skin',
\n
"
,
#level = [df['Prediction'].unique()]
" 'No_unpleasant_Smell','Musty_smell','Extreme_musty_smell',
\n
"
,
" 'No_Itching_and_Scratching','Itching_and_Scratching-time_to_time','Itching_and_Scratching-constantly',
\n
"
,
" 'No_Thickened_Skin','Thickened_Skin','Extremely_Thickened_Skin(Elephant_skin_appearance)',
\n
"
,
# In[4]:
" 'No_Hair_Loss','Starting_Hair_Loss','Hair_Loss',
\n
"
,
" 'No_Hearing_Issues','Hearing_Issues','Deafness']"
]
l2
=
[]
},
for
i
in
range
(
0
,
len
(
l1
)):
{
l2
.
append
(
0
)
"cell_type"
:
"code"
,
print
(
l2
)
"execution_count"
:
3
,
"id"
:
"88ebf3aa"
,
"metadata"
:
{},
# In[5]:
"outputs"
:
[],
"source"
:
[
"#List of Severity Levels.
\n
"
,
#Reading the training.csv file
"level=['Primary','Secondary','Tertiary']
\n
"
,
df
=
pd
.
read_csv
(
"severity level.csv"
)
"
\n
"
,
DF
=
pd
.
read_csv
(
"severity level.csv"
,
index_col
=
'Prediction'
)
"#level = [df['Prediction'].unique()]"
]
#Replace the values in the imported file by pandas by the inbuilt function replace in pandas.
},
{
df
.
replace
({
'Prediction'
:{
'Primary'
:
0
,
'Secondary'
:
1
,
'Tertiary'
:
2
}},
inplace
=
True
)
"cell_type"
:
"code"
,
#df.head()
"execution_count"
:
4
,
DF
.
head
()
"id"
:
"1bad964f"
,
"metadata"
:
{},
"outputs"
:
[
# In[6]:
{
"name"
:
"stdout"
,
"output_type"
:
"stream"
,
X
=
df
[
l1
]
"text"
:
[
y
=
df
[[
"Prediction"
]]
"[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
\n
"
np
.
ravel
(
y
)
]
print
(
X
)
}
],
"source"
:
[
# In[7]:
"l2=[]
\n
"
,
"for i in range(0,len(l1)):
\n
"
,
" l2.append(0)
\n
"
,
#Reading the testing.csv file
"print(l2)"
tr
=
pd
.
read_csv
(
"testing.csv"
)
]
},
#Using inbuilt function replace in pandas for replacing the values
{
"cell_type"
:
"code"
,
tr
.
replace
({
'Prediction'
:{
'Primary'
:
0
,
'Secondary'
:
1
,
'Tertiary'
:
2
}},
inplace
=
True
)
"execution_count"
:
5
,
tr
.
head
()
"id"
:
"a763e537"
,
"metadata"
:
{},
"outputs"
:
[
# In[8]:
{
"data"
:
{
"text/html"
:
[
X_test
=
tr
[
l1
]
"<div>
\n
"
,
y_test
=
tr
[[
"Prediction"
]]
"<style scoped>
\n
"
,
np
.
ravel
(
y_test
)
" .dataframe tbody tr th:only-of-type {
\n
"
,
print
(
X_test
)
" vertical-align: middle;
\n
"
,
" }
\n
"
,
"
\n
"
,
# In[9]:
" .dataframe tbody tr th {
\n
"
,
" vertical-align: top;
\n
"
,
" }
\n
"
,
print
(
y_test
)
"
\n
"
,
" .dataframe thead th {
\n
"
,
" text-align: right;
\n
"
,
# Decision Tree Algorithm
" }
\n
"
,
"</style>
\n
"
,
# In[10]:
"<table border=
\"
1
\"
class=
\"
dataframe
\"
>
\n
"
,
" <thead>
\n
"
,
" <tr style=
\"
text-align: right;
\"
>
\n
"
,
root
=
Tk
()
" <th></th>
\n
"
,
pred1
=
StringVar
()
" <th>Yeast_Visibility-ears,armpits,_or_paws</th>
\n
"
,
def
DecisionTree
():
" <th>Yeast_Visibility-around_half_of_the_body</th>
\n
"
,
if
len
(
NameEn
.
get
())
==
0
:
" <th>Yeast_Visibility-whole_body</th>
\n
"
,
pred1
.
set
(
" "
)
" <th>Redness-pink_or_red_skin</th>
\n
"
,
comp
=
messagebox
.
askokcancel
(
"System"
,
"Please fill the breed of your pet !"
)
" <th>Redness-red_skin</th>
\n
"
,
if
comp
:
" <th>Redness-gray_or_black_skin</th>
\n
"
,
root
.
mainloop
()
" <th>No_unpleasant_Smell</th>
\n
"
,
elif
((
Symptom1
.
get
()
==
"Select Here"
)
or
(
Symptom2
.
get
()
==
"Select Here"
)
):
" <th>Musty_smell</th>
\n
"
,
pred1
.
set
(
" "
)
" <th>Extreme_musty_smell</th>
\n
"
,
sym
=
messagebox
.
askokcancel
(
"System"
,
"Please fill atleast first two Symptoms"
)
" <th>No_Itching_and_Scratching</th>
\n
"
,
if
sym
:
" <th>...</th>
\n
"
,
root
.
mainloop
()
" <th>Itching_and_Scratching-constantly</th>
\n
"
,
else
:
" <th>No_Thickened_Skin</th>
\n
"
,
from
sklearn
import
tree
" <th>Thickened_Skin</th>
\n
"
,
" <th>Extremely_Thickened_Skin(Elephant_skin_appearance)</th>
\n
"
,
clf3
=
tree
.
DecisionTreeClassifier
()
" <th>No_Hair_Loss</th>
\n
"
,
clf3
=
clf3
.
fit
(
X
,
y
)
" <th>Starting_Hair_Loss</th>
\n
"
,
" <th>Hair_Loss</th>
\n
"
,
from
sklearn.metrics
import
classification_report
,
confusion_matrix
,
accuracy_score
" <th>No_Hearing_Issues</th>
\n
"
,
y_pred
=
clf3
.
predict
(
X_test
)
" <th>Hearing_Issues</th>
\n
"
,
print
(
"Decision Tree"
)
" <th>Deafness</th>
\n
"
,
print
(
"Accuracy"
)
" </tr>
\n
"
,
print
(
accuracy_score
(
y_test
,
y_pred
))
" <tr>
\n
"
,
print
(
accuracy_score
(
y_test
,
y_pred
,
normalize
=
False
))
" <th>Prediction</th>
\n
"
,
print
(
"Confusion matrix"
)
" <th></th>
\n
"
,
conf_matrix
=
confusion_matrix
(
y_test
,
y_pred
)
" <th></th>
\n
"
,
print
(
conf_matrix
)
" <th></th>
\n
"
,
" <th></th>
\n
"
,
psymptoms
=
[
Symptom1
.
get
(),
Symptom2
.
get
(),
Symptom3
.
get
(),
Symptom4
.
get
(),
Symptom5
.
get
(),
Symptom6
.
get
(),
Symptom7
.
get
()]
" <th></th>
\n
"
,
" <th></th>
\n
"
,
for
k
in
range
(
0
,
len
(
l1
)):
" <th></th>
\n
"
,
for
z
in
psymptoms
:
" <th></th>
\n
"
,
if
(
z
==
l1
[
k
]):
" <th></th>
\n
"
,
l2
[
k
]
=
1
" <th></th>
\n
"
,
inputtest
=
[
l2
]
" <th></th>
\n
"
,
predict
=
clf3
.
predict
(
inputtest
)
" <th></th>
\n
"
,
predicted
=
predict
[
0
]
" <th></th>
\n
"
,
" <th></th>
\n
"
,
h
=
'no'
" <th></th>
\n
"
,
for
a
in
range
(
0
,
len
(
level
)):
" <th></th>
\n
"
,
if
(
predicted
==
a
):
" <th></th>
\n
"
,
h
=
'yes'
" <th></th>
\n
"
,
break
" <th></th>
\n
"
,
" <th></th>
\n
"
,
" <th></th>
\n
"
,
if
(
h
==
'yes'
):
" </tr>
\n
"
,
pred1
.
set
(
" "
)
" </thead>
\n
"
,
pred1
.
set
(
level
[
a
])
" <tbody>
\n
"
,
else
:
" <tr>
\n
"
,
pred1
.
set
(
" "
)
" <th>Primary</th>
\n
"
,
pred1
.
set
(
"Not Found"
)
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
# Random Forest Algorithm
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
# In[11]:
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
pred2
=
StringVar
()
" <td>0</td>
\n
"
,
def
randomforest
():
" <td>1</td>
\n
"
,
if
len
(
NameEn
.
get
())
==
0
:
" <td>...</td>
\n
"
,
pred1
.
set
(
" "
)
" <td>0</td>
\n
"
,
comp
=
messagebox
.
askokcancel
(
"System"
,
"Please fill the breed of your pet !"
)
" <td>1</td>
\n
"
,
if
comp
:
" <td>0</td>
\n
"
,
root
.
mainloop
()
" <td>0</td>
\n
"
,
elif
((
Symptom1
.
get
()
==
"Select Here"
)
or
(
Symptom2
.
get
()
==
"Select Here"
)):
" <td>1</td>
\n
"
,
pred1
.
set
(
" "
)
" <td>0</td>
\n
"
,
sym
=
messagebox
.
askokcancel
(
"System"
,
"Please fill atleast first two Symptoms"
)
" <td>0</td>
\n
"
,
if
sym
:
" <td>1</td>
\n
"
,
root
.
mainloop
()
" <td>0</td>
\n
"
,
else
:
" <td>0</td>
\n
"
,
from
sklearn.ensemble
import
RandomForestClassifier
" </tr>
\n
"
,
clf4
=
RandomForestClassifier
(
n_estimators
=
100
)
" <tr>
\n
"
,
clf4
=
clf4
.
fit
(
X
,
np
.
ravel
(
y
))
" <th>Primary</th>
\n
"
,
" <td>1</td>
\n
"
,
# calculating accuracy
" <td>0</td>
\n
"
,
from
sklearn.metrics
import
classification_report
,
confusion_matrix
,
accuracy_score
" <td>0</td>
\n
"
,
y_pred
=
clf4
.
predict
(
X_test
)
" <td>1</td>
\n
"
,
print
(
"Random Forest"
)
" <td>0</td>
\n
"
,
print
(
"Accuracy"
)
" <td>0</td>
\n
"
,
print
(
accuracy_score
(
y_test
,
y_pred
))
" <td>1</td>
\n
"
,
print
(
accuracy_score
(
y_test
,
y_pred
,
normalize
=
False
))
" <td>0</td>
\n
"
,
print
(
"Confusion matrix"
)
" <td>0</td>
\n
"
,
conf_matrix
=
confusion_matrix
(
y_test
,
y_pred
)
" <td>1</td>
\n
"
,
print
(
conf_matrix
)
" <td>...</td>
\n
"
,
" <td>0</td>
\n
"
,
psymptoms
=
[
Symptom1
.
get
(),
Symptom2
.
get
(),
Symptom3
.
get
(),
Symptom4
.
get
(),
Symptom5
.
get
(),
Symptom6
.
get
(),
Symptom7
.
get
()]
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
for
k
in
range
(
0
,
len
(
l1
)):
" <td>0</td>
\n
"
,
for
z
in
psymptoms
:
" <td>1</td>
\n
"
,
if
(
z
==
l1
[
k
]):
" <td>0</td>
\n
"
,
l2
[
k
]
=
1
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
inputtest
=
[
l2
]
" <td>0</td>
\n
"
,
predict
=
clf4
.
predict
(
inputtest
)
" <td>0</td>
\n
"
,
predicted
=
predict
[
0
]
" </tr>
\n
"
,
" <tr>
\n
"
,
h
=
'no'
" <th>Primary</th>
\n
"
,
for
a
in
range
(
0
,
len
(
level
)):
" <td>1</td>
\n
"
,
if
(
predicted
==
a
):
" <td>0</td>
\n
"
,
h
=
'yes'
" <td>0</td>
\n
"
,
break
" <td>1</td>
\n
"
,
if
(
h
==
'yes'
):
" <td>0</td>
\n
"
,
pred2
.
set
(
" "
)
" <td>0</td>
\n
"
,
pred2
.
set
(
level
[
a
])
" <td>1</td>
\n
"
,
else
:
" <td>0</td>
\n
"
,
pred2
.
set
(
" "
)
" <td>0</td>
\n
"
,
pred2
.
set
(
"Not Found"
)
" <td>1</td>
\n
"
,
" <td>...</td>
\n
"
,
" <td>0</td>
\n
"
,
# Building Graphical User Interface
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
# In[12]:
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
#Tk class is used to create a root window
" <td>0</td>
\n
"
,
root
.
configure
(
background
=
'Ivory'
)
" <td>1</td>
\n
"
,
root
.
title
(
'Skin Disease Severity Level Predictor System'
)
" <td>0</td>
\n
"
,
root
.
resizable
(
0
,
0
)
" <td>0</td>
\n
"
,
" </tr>
\n
"
,
" <tr>
\n
"
,
# In[13]:
" <th>Primary</th>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom1
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom1
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom2
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom2
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom3
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom3
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
" <td>...</td>
\n
"
,
Symptom4
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom4
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom5
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom5
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom6
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom6
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom7
=
StringVar
()
" <td>0</td>
\n
"
,
Symptom7
.
set
(
"Select Here"
)
" </tr>
\n
"
,
Name
=
StringVar
()
" <tr>
\n
"
,
" <th>Primary</th>
\n
"
,
" <td>1</td>
\n
"
,
# In[14]:
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
prev_win
=
None
" <td>0</td>
\n
"
,
def
Reset
():
" <td>0</td>
\n
"
,
global
prev_win
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
Symptom1
.
set
(
"Select Here"
)
" <td>0</td>
\n
"
,
Symptom2
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
Symptom3
.
set
(
"Select Here"
)
" <td>...</td>
\n
"
,
Symptom4
.
set
(
"Select Here"
)
" <td>0</td>
\n
"
,
Symptom5
.
set
(
"Select Here"
)
" <td>1</td>
\n
"
,
Symptom6
.
set
(
"Select Here"
)
" <td>0</td>
\n
"
,
Symptom7
.
set
(
"Select Here"
)
" <td>0</td>
\n
"
,
NameEn
.
delete
(
first
=
0
,
last
=
100
)
" <td>1</td>
\n
"
,
pred1
.
set
(
" "
)
" <td>0</td>
\n
"
,
pred2
.
set
(
" "
)
" <td>0</td>
\n
"
,
try
:
" <td>1</td>
\n
"
,
prev_win
.
destroy
()
" <td>0</td>
\n
"
,
prev_win
=
None
" <td>0</td>
\n
"
,
except
AttributeError
:
" </tr>
\n
"
,
pass
" </tbody>
\n
"
,
"</table>
\n
"
,
"<p>5 rows × 21 columns</p>
\n
"
,
# In[15]:
"</div>"
],
"text/plain"
:
[
from
tkinter
import
messagebox
" Yeast_Visibility-ears,armpits,_or_paws
\\\n
"
,
def
Exit
():
"Prediction
\n
"
,
qExit
=
messagebox
.
askyesno
(
"System"
,
"Do you want to exit the system ?"
)
"Primary 1
\n
"
,
"Primary 1
\n
"
,
if
qExit
:
"Primary 1
\n
"
,
root
.
destroy
()
"Primary 1
\n
"
,
exit
()
"Primary 1
\n
"
,
"
\n
"
,
" Yeast_Visibility-around_half_of_the_body
\\\n
"
,
# In[16]:
"Prediction
\n
"
,
"Primary 0
\n
"
,
"Primary 0
\n
"
,
#Headings for the GUI written at the top of GUI
"Primary 0
\n
"
,
w2
=
Label
(
root
,
justify
=
LEFT
,
text
=
"Skin Disease Severity Level Prediction"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"Primary 0
\n
"
,
w2
.
config
(
font
=
(
"Times"
,
30
,
"bold"
))
"Primary 0
\n
"
,
w2
.
grid
(
row
=
1
,
column
=
0
,
columnspan
=
2
,
padx
=
100
)
"
\n
"
,
" Yeast_Visibility-whole_body Redness-pink_or_red_skin
\\\n
"
,
"Prediction
\n
"
,
# In[17]:
"Primary 0 1
\n
"
,
"Primary 0 1
\n
"
,
"Primary 0 1
\n
"
,
#Label for the name
"Primary 0 1
\n
"
,
NameLb
=
Label
(
root
,
text
=
"Breed of the Pet *"
,
fg
=
"Dark Blue"
,
bg
=
"Ivory"
)
"Primary 0 1
\n
"
,
NameLb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"
\n
"
,
NameLb
.
grid
(
row
=
6
,
column
=
0
,
pady
=
15
,
sticky
=
W
)
" Redness-red_skin Redness-gray_or_black_skin No_unpleasant_Smell
\\\n
"
,
"Prediction
\n
"
,
"Primary 0 0 1
\n
"
,
# In[18]:
"Primary 0 0 1
\n
"
,
"Primary 0 0 1
\n
"
,
"Primary 0 0 1
\n
"
,
#Creating Labels for the symtoms
"Primary 0 0 1
\n
"
,
S1Lb
=
Label
(
root
,
text
=
"Symptom 1 *"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"
\n
"
,
S1Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
" Musty_smell Extreme_musty_smell No_Itching_and_Scratching ...
\\\n
"
,
S1Lb
.
grid
(
row
=
7
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Prediction ...
\n
"
,
"Primary 0 0 1 ...
\n
"
,
S2Lb
=
Label
(
root
,
text
=
"Symptom 2 *"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"Primary 0 0 1 ...
\n
"
,
S2Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"Primary 0 0 1 ...
\n
"
,
S2Lb
.
grid
(
row
=
8
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Primary 0 0 1 ...
\n
"
,
"Primary 0 0 1 ...
\n
"
,
S3Lb
=
Label
(
root
,
text
=
"Symptom 3"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"
\n
"
,
S3Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
" Itching_and_Scratching-constantly No_Thickened_Skin
\\\n
"
,
S3Lb
.
grid
(
row
=
9
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Prediction
\n
"
,
"Primary 0 1
\n
"
,
S4Lb
=
Label
(
root
,
text
=
"Symptom 4"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"Primary 0 1
\n
"
,
S4Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"Primary 0 1
\n
"
,
S4Lb
.
grid
(
row
=
10
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Primary 0 1
\n
"
,
"Primary 0 1
\n
"
,
S5Lb
=
Label
(
root
,
text
=
"Symptom 5"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"
\n
"
,
S5Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
" Thickened_Skin
\\\n
"
,
S5Lb
.
grid
(
row
=
11
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Prediction
\n
"
,
"Primary 0
\n
"
,
S6Lb
=
Label
(
root
,
text
=
"Symptom 6"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"Primary 0
\n
"
,
S6Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"Primary 0
\n
"
,
S6Lb
.
grid
(
row
=
12
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Primary 0
\n
"
,
"Primary 0
\n
"
,
S7Lb
=
Label
(
root
,
text
=
"Symptom 7"
,
fg
=
"Black"
,
bg
=
"Ivory"
)
"
\n
"
,
S7Lb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
" Extremely_Thickened_Skin(Elephant_skin_appearance) No_Hair_Loss
\\\n
"
,
S7Lb
.
grid
(
row
=
13
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Prediction
\n
"
,
"Primary 0 1
\n
"
,
"Primary 0 1
\n
"
,
# In[19]:
"Primary 0 1
\n
"
,
"Primary 0 1
\n
"
,
"Primary 0 1
\n
"
,
#Labels for the different algorithms
"
\n
"
,
lrLb
=
Label
(
root
,
text
=
"DecisionTree"
,
fg
=
"black"
,
bg
=
"Light blue"
,
width
=
20
)
" Starting_Hair_Loss Hair_Loss No_Hearing_Issues Hearing_Issues
\\\n
"
,
lrLb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"Prediction
\n
"
,
lrLb
.
grid
(
row
=
15
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Primary 0 0 1 0
\n
"
,
"Primary 0 0 1 0
\n
"
,
destreeLb
=
Label
(
root
,
text
=
"RandomForest"
,
fg
=
"black"
,
bg
=
"Light blue"
,
width
=
20
)
"Primary 0 0 1 0
\n
"
,
destreeLb
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"Primary 0 0 1 0
\n
"
,
destreeLb
.
grid
(
row
=
17
,
column
=
0
,
pady
=
10
,
sticky
=
W
)
"Primary 0 0 1 0
\n
"
,
OPTIONS
=
sorted
(
l1
)
"
\n
"
,
" Deafness
\n
"
,
"Prediction
\n
"
,
# In[20]:
"Primary 0
\n
"
,
"Primary 0
\n
"
,
"Primary 0
\n
"
,
#Taking breed-name as input from user
"Primary 0
\n
"
,
NameEn
=
Entry
(
root
,
textvariable
=
Name
)
"Primary 0
\n
"
,
NameEn
.
grid
(
row
=
6
,
column
=
1
)
"
\n
"
,
"[5 rows x 21 columns]"
#Taking Symptoms as input from the dropdown from the user
]
S1
=
OptionMenu
(
root
,
Symptom1
,
*
OPTIONS
)
},
S1
.
grid
(
row
=
7
,
column
=
1
)
"execution_count"
:
5
,
"metadata"
:
{},
S2
=
OptionMenu
(
root
,
Symptom2
,
*
OPTIONS
)
"output_type"
:
"execute_result"
S2
.
grid
(
row
=
8
,
column
=
1
)
}
],
S3
=
OptionMenu
(
root
,
Symptom3
,
*
OPTIONS
)
"source"
:
[
S3
.
grid
(
row
=
9
,
column
=
1
)
"#Reading the training.csv file
\n
"
,
"df=pd.read_csv(
\"
severity level.csv
\"
)
\n
"
,
S4
=
OptionMenu
(
root
,
Symptom4
,
*
OPTIONS
)
"DF=pd.read_csv(
\"
severity level.csv
\"
, index_col='Prediction')
\n
"
,
S4
.
grid
(
row
=
10
,
column
=
1
)
"
\n
"
,
"#Replace the values in the imported file by pandas by the inbuilt function replace in pandas.
\n
"
,
S5
=
OptionMenu
(
root
,
Symptom5
,
*
OPTIONS
)
"
\n
"
,
S5
.
grid
(
row
=
11
,
column
=
1
)
"df.replace({'Prediction':{'Primary':0,'Secondary':1,'Tertiary':2}},inplace=True)
\n
"
,
"DF.head()"
S6
=
OptionMenu
(
root
,
Symptom6
,
*
OPTIONS
)
]
S6
.
grid
(
row
=
12
,
column
=
1
)
},
{
S7
=
OptionMenu
(
root
,
Symptom7
,
*
OPTIONS
)
"cell_type"
:
"code"
,
S7
.
grid
(
row
=
13
,
column
=
1
)
"execution_count"
:
6
,
"id"
:
"87e4e740"
,
"metadata"
:
{},
# In[21]:
"outputs"
:
[
{
"name"
:
"stdout"
,
#Buttons for predicting the severity level using different algorithms
"output_type"
:
"stream"
,
dst
=
Button
(
root
,
text
=
"Prediction 1"
,
command
=
DecisionTree
,
bg
=
"Blue"
,
fg
=
"yellow"
)
"text"
:
[
dst
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
" Yeast_Visibility-ears,armpits,_or_paws
\\\n
"
,
dst
.
grid
(
row
=
6
,
column
=
3
,
padx
=
10
)
"0 1
\n
"
,
"1 1
\n
"
,
rnf
=
Button
(
root
,
text
=
"Prediction 2"
,
command
=
randomforest
,
bg
=
"Blue"
,
fg
=
"yellow"
)
"2 1
\n
"
,
rnf
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"3 1
\n
"
,
rnf
.
grid
(
row
=
7
,
column
=
3
,
padx
=
10
)
"4 1
\n
"
,
"5 1
\n
"
,
rs
=
Button
(
root
,
text
=
"Reset Inputs"
,
command
=
Reset
,
bg
=
"yellow"
,
fg
=
"purple"
,
width
=
12
)
"6 1
\n
"
,
rs
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"7 1
\n
"
,
rs
.
grid
(
row
=
10
,
column
=
3
,
padx
=
10
)
"8 1
\n
"
,
"9 1
\n
"
,
ex
=
Button
(
root
,
text
=
"Exit System"
,
command
=
Exit
,
bg
=
"yellow"
,
fg
=
"purple"
,
width
=
12
)
"10 1
\n
"
,
ex
.
config
(
font
=
(
"Times"
,
15
,
"bold"
))
"11 1
\n
"
,
ex
.
grid
(
row
=
11
,
column
=
3
,
padx
=
10
)
"12 1
\n
"
,
"13 1
\n
"
,
"14 1
\n
"
,
# In[22]:
"15 1
\n
"
,
"16 1
\n
"
,
"17 1
\n
"
,
#Showing the output of different algorithms
"18 1
\n
"
,
t1
=
Label
(
root
,
font
=
(
"Times"
,
15
,
"bold"
),
text
=
"Decision Tree"
,
height
=
1
,
bg
=
"Light green"
"19 0
\n
"
,
,
width
=
40
,
fg
=
"black"
,
textvariable
=
pred1
,
relief
=
"sunken"
)
.
grid
(
row
=
15
,
column
=
1
,
padx
=
10
)
"20 0
\n
"
,
"21 0
\n
"
,
t2
=
Label
(
root
,
font
=
(
"Times"
,
15
,
"bold"
),
text
=
"Random Forest"
,
height
=
1
,
bg
=
"Light green"
"22 0
\n
"
,
,
width
=
40
,
fg
=
"black"
,
textvariable
=
pred2
,
relief
=
"sunken"
)
.
grid
(
row
=
17
,
column
=
1
,
padx
=
10
)
"23 0
\n
"
,
"24 0
\n
"
,
"25 0
\n
"
,
# In[23]:
"26 0
\n
"
,
"27 0
\n
"
,
"28 0
\n
"
,
#calling this function because the application is ready to run
"29 0
\n
"
,
root
.
mainloop
()
"30 0
\n
"
,
"31 0
\n
"
,
"32 0
\n
"
,
# In[ ]:
"33 0
\n
"
,
"34 0
\n
"
,
"35 0
\n
"
,
"36 0
\n
"
,
"37 0
\n
"
,
"38 0
\n
"
,
"39 0
\n
"
,
"40 0
\n
"
,
"41 0
\n
"
,
"42 0
\n
"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" No_Itching_and_Scratching ... Itching_and_Scratching-constantly
\\\n
"
,
"0 1 ... 0
\n
"
,
"1 1 ... 0
\n
"
,
"2 1 ... 0
\n
"
,
"3 1 ... 0
\n
"
,
"4 1 ... 0
\n
"
,
"5 1 ... 0
\n
"
,
"6 1 ... 0
\n
"
,
"7 1 ... 0
\n
"
,
"8 1 ... 0
\n
"
,
"9 1 ... 0
\n
"
,
"10 1 ... 0
\n
"
,
"11 1 ... 0
\n
"
,
"12 1 ... 0
\n
"
,
"13 1 ... 0
\n
"
,
"14 1 ... 0
\n
"
,
"15 1 ... 0
\n
"
,
"16 1 ... 0
\n
"
,
"17 1 ... 0
\n
"
,
"18 1 ... 0
\n
"
,
"19 0 ... 0
\n
"
,
"20 0 ... 0
\n
"
,
"21 0 ... 0
\n
"
,
"22 0 ... 0
\n
"
,
"23 0 ... 0
\n
"
,
"24 0 ... 0
\n
"
,
"25 0 ... 0
\n
"
,
"26 0 ... 0
\n
"
,
"27 0 ... 0
\n
"
,
"28 0 ... 0
\n
"
,
"29 0 ... 0
\n
"
,
"30 0 ... 0
\n
"
,
"31 0 ... 0
\n
"
,
"32 0 ... 0
\n
"
,
"33 0 ... 0
\n
"
,
"34 0 ... 0
\n
"
,
"35 0 ... 0
\n
"
,
"36 0 ... 0
\n
"
,
"37 0 ... 0
\n
"
,
"38 0 ... 0
\n
"
,
"39 0 ... 1
\n
"
,
"40 0 ... 1
\n
"
,
"41 0 ... 1
\n
"
,
"42 0 ... 1
\n
"
,
"43 0 ... 1
\n
"
,
"44 0 ... 1
\n
"
,
"45 0 ... 1
\n
"
,
"46 0 ... 1
\n
"
,
"47 0 ... 1
\n
"
,
"48 0 ... 1
\n
"
,
"49 0 ... 1
\n
"
,
"50 0 ... 1
\n
"
,
"51 0 ... 1
\n
"
,
"52 0 ... 1
\n
"
,
"53 0 ... 1
\n
"
,
"54 0 ... 1
\n
"
,
"55 0 ... 1
\n
"
,
"56 0 ... 1
\n
"
,
"57 0 ... 1
\n
"
,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ction
\"
]]
\n
"
,
"np.ravel(y)
\n
"
,
"print(X)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
7
,
"id"
:
"7678d75d"
,
"metadata"
:
{},
"outputs"
:
[
{
"data"
:
{
"text/html"
:
[
"<div>
\n
"
,
"<style scoped>
\n
"
,
" .dataframe tbody tr th:only-of-type {
\n
"
,
" vertical-align: middle;
\n
"
,
" }
\n
"
,
"
\n
"
,
" .dataframe tbody tr th {
\n
"
,
" vertical-align: top;
\n
"
,
" }
\n
"
,
"
\n
"
,
" .dataframe thead th {
\n
"
,
" text-align: right;
\n
"
,
" }
\n
"
,
"</style>
\n
"
,
"<table border=
\"
1
\"
class=
\"
dataframe
\"
>
\n
"
,
" <thead>
\n
"
,
" <tr style=
\"
text-align: right;
\"
>
\n
"
,
" <th></th>
\n
"
,
" <th>Yeast_Visibility-ears,armpits,_or_paws</th>
\n
"
,
" <th>Yeast_Visibility-around_half_of_the_body</th>
\n
"
,
" <th>Yeast_Visibility-whole_body</th>
\n
"
,
" <th>Redness-pink_or_red_skin</th>
\n
"
,
" <th>Redness-red_skin</th>
\n
"
,
" <th>Redness-gray_or_black_skin</th>
\n
"
,
" <th>No_unpleasant_Smell</th>
\n
"
,
" <th>Musty_smell</th>
\n
"
,
" <th>Extreme_musty_smell</th>
\n
"
,
" <th>No_Itching_and_Scratching</th>
\n
"
,
" <th>...</th>
\n
"
,
" <th>No_Thickened_Skin</th>
\n
"
,
" <th>Thickened_Skin</th>
\n
"
,
" <th>Extremely_Thickened_Skin(Elephant_skin_appearance)</th>
\n
"
,
" <th>No_Hair_Loss</th>
\n
"
,
" <th>Starting_Hair_Loss</th>
\n
"
,
" <th>Hair_Loss</th>
\n
"
,
" <th>No_Hearing_Issues</th>
\n
"
,
" <th>Hearing_Issues</th>
\n
"
,
" <th>Deafness</th>
\n
"
,
" <th>Prediction</th>
\n
"
,
" </tr>
\n
"
,
" </thead>
\n
"
,
" <tbody>
\n
"
,
" <tr>
\n
"
,
" <th>0</th>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>...</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" </tr>
\n
"
,
" <tr>
\n
"
,
" <th>1</th>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>...</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" </tr>
\n
"
,
" <tr>
\n
"
,
" <th>2</th>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>...</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" </tr>
\n
"
,
" <tr>
\n
"
,
" <th>3</th>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>...</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" </tr>
\n
"
,
" <tr>
\n
"
,
" <th>4</th>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>...</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" <td>0</td>
\n
"
,
" <td>1</td>
\n
"
,
" </tr>
\n
"
,
" </tbody>
\n
"
,
"</table>
\n
"
,
"<p>5 rows × 22 columns</p>
\n
"
,
"</div>"
],
"text/plain"
:
[
" Yeast_Visibility-ears,armpits,_or_paws
\\\n
"
,
"0 1
\n
"
,
"1 1
\n
"
,
"2 1
\n
"
,
"3 1
\n
"
,
"4 0
\n
"
,
"
\n
"
,
" Yeast_Visibility-around_half_of_the_body Yeast_Visibility-whole_body
\\\n
"
,
"0 0 0
\n
"
,
"1 0 0
\n
"
,
"2 0 0
\n
"
,
"3 0 0
\n
"
,
"4 1 0
\n
"
,
"
\n
"
,
" Redness-pink_or_red_skin Redness-red_skin Redness-gray_or_black_skin
\\\n
"
,
"0 1 0 0
\n
"
,
"1 1 0 0
\n
"
,
"2 1 0 0
\n
"
,
"3 1 0 0
\n
"
,
"4 0 1 0
\n
"
,
"
\n
"
,
" No_unpleasant_Smell Musty_smell Extreme_musty_smell
\\\n
"
,
"0 1 0 0
\n
"
,
"1 1 0 0
\n
"
,
"2 1 0 0
\n
"
,
"3 1 0 0
\n
"
,
"4 0 1 0
\n
"
,
"
\n
"
,
" No_Itching_and_Scratching ... No_Thickened_Skin Thickened_Skin
\\\n
"
,
"0 1 ... 1 0
\n
"
,
"1 1 ... 1 0
\n
"
,
"2 1 ... 1 0
\n
"
,
"3 1 ... 1 0
\n
"
,
"4 0 ... 0 1
\n
"
,
"
\n
"
,
" Extremely_Thickened_Skin(Elephant_skin_appearance) No_Hair_Loss
\\\n
"
,
"0 0 1
\n
"
,
"1 0 1
\n
"
,
"2 0 1
\n
"
,
"3 0 1
\n
"
,
"4 0 0
\n
"
,
"
\n
"
,
" Starting_Hair_Loss Hair_Loss No_Hearing_Issues Hearing_Issues Deafness
\\\n
"
,
"0 0 0 1 0 0
\n
"
,
"1 0 0 1 0 0
\n
"
,
"2 0 0 1 0 0
\n
"
,
"3 0 0 1 0 0
\n
"
,
"4 1 0 0 1 0
\n
"
,
"
\n
"
,
" Prediction
\n
"
,
"0 0
\n
"
,
"1 0
\n
"
,
"2 0
\n
"
,
"3 0
\n
"
,
"4 1
\n
"
,
"
\n
"
,
"[5 rows x 22 columns]"
]
},
"execution_count"
:
7
,
"metadata"
:
{},
"output_type"
:
"execute_result"
}
],
"source"
:
[
"#Reading the testing.csv file
\n
"
,
"tr=pd.read_csv(
\"
testing.csv
\"
)
\n
"
,
"
\n
"
,
"tr.replace({'Prediction':{'Primary':0,'Secondary':1,'Tertiary':2}},inplace=True)
\n
"
,
"tr.head()"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
8
,
"id"
:
"1e7a74a7"
,
"metadata"
:
{},
"outputs"
:
[
{
"name"
:
"stdout"
,
"output_type"
:
"stream"
,
"text"
:
[
" Yeast_Visibility-ears,armpits,_or_paws
\\\n
"
,
"0 1
\n
"
,
"1 1
\n
"
,
"2 1
\n
"
,
"3 1
\n
"
,
"4 0
\n
"
,
"5 0
\n
"
,
"6 0
\n
"
,
"7 0
\n
"
,
"8 0
\n
"
,
"9 0
\n
"
,
"10 0
\n
"
,
"11 0
\n
"
,
"12 0
\n
"
,
"13 0
\n
"
,
"
\n
"
,
" Yeast_Visibility-around_half_of_the_body Yeast_Visibility-whole_body
\\\n
"
,
"0 0 0
\n
"
,
"1 0 0
\n
"
,
"2 0 0
\n
"
,
"3 0 0
\n
"
,
"4 1 0
\n
"
,
"5 1 0
\n
"
,
"6 1 0
\n
"
,
"7 1 0
\n
"
,
"8 1 0
\n
"
,
"9 0 1
\n
"
,
"10 0 1
\n
"
,
"11 0 1
\n
"
,
"12 0 1
\n
"
,
"13 0 1
\n
"
,
"
\n
"
,
" Redness-pink_or_red_skin Redness-red_skin Redness-gray_or_black_skin
\\\n
"
,
"0 1 0 0
\n
"
,
"1 1 0 0
\n
"
,
"2 1 0 0
\n
"
,
"3 1 0 0
\n
"
,
"4 0 1 0
\n
"
,
"5 0 1 0
\n
"
,
"6 0 1 0
\n
"
,
"7 0 1 0
\n
"
,
"8 0 1 0
\n
"
,
"9 0 0 1
\n
"
,
"10 0 0 1
\n
"
,
"11 0 0 1
\n
"
,
"12 0 0 1
\n
"
,
"13 0 0 1
\n
"
,
"
\n
"
,
" No_unpleasant_Smell Musty_smell Extreme_musty_smell
\\\n
"
,
"0 1 0 0
\n
"
,
"1 1 0 0
\n
"
,
"2 1 0 0
\n
"
,
"3 1 0 0
\n
"
,
"4 0 1 0
\n
"
,
"5 0 1 0
\n
"
,
"6 0 1 0
\n
"
,
"7 0 1 0
\n
"
,
"8 0 1 0
\n
"
,
"9 0 0 1
\n
"
,
"10 0 0 1
\n
"
,
"11 0 0 1
\n
"
,
"12 0 0 1
\n
"
,
"13 0 0 1
\n
"
,
"
\n
"
,
" No_Itching_and_Scratching ... Itching_and_Scratching-constantly
\\\n
"
,
"0 1 ... 0
\n
"
,
"1 1 ... 0
\n
"
,
"2 1 ... 0
\n
"
,
"3 1 ... 0
\n
"
,
"4 0 ... 0
\n
"
,
"5 0 ... 0
\n
"
,
"6 0 ... 0
\n
"
,
"7 0 ... 0
\n
"
,
"8 0 ... 0
\n
"
,
"9 0 ... 1
\n
"
,
"10 0 ... 1
\n
"
,
"11 0 ... 1
\n
"
,
"12 0 ... 1
\n
"
,
"13 0 ... 1
\n
"
,
"
\n
"
,
" No_Thickened_Skin Thickened_Skin
\\\n
"
,
"0 1 0
\n
"
,
"1 1 0
\n
"
,
"2 1 0
\n
"
,
"3 1 0
\n
"
,
"4 0 1
\n
"
,
"5 0 1
\n
"
,
"6 0 1
\n
"
,
"7 0 1
\n
"
,
"8 0 1
\n
"
,
"9 0 0
\n
"
,
"10 0 0
\n
"
,
"11 0 0
\n
"
,
"12 0 0
\n
"
,
"13 0 0
\n
"
,
"
\n
"
,
" Extremely_Thickened_Skin(Elephant_skin_appearance) No_Hair_Loss
\\\n
"
,
"0 0 1
\n
"
,
"1 0 1
\n
"
,
"2 0 1
\n
"
,
"3 0 1
\n
"
,
"4 0 0
\n
"
,
"5 0 0
\n
"
,
"6 0 0
\n
"
,
"7 0 0
\n
"
,
"8 0 0
\n
"
,
"9 1 0
\n
"
,
"10 1 0
\n
"
,
"11 1 0
\n
"
,
"12 1 0
\n
"
,
"13 1 0
\n
"
,
"
\n
"
,
" Starting_Hair_Loss Hair_Loss No_Hearing_Issues Hearing_Issues Deafness
\n
"
,
"0 0 0 1 0 0
\n
"
,
"1 0 0 1 0 0
\n
"
,
"2 0 0 1 0 0
\n
"
,
"3 0 0 1 0 0
\n
"
,
"4 1 0 0 1 0
\n
"
,
"5 1 0 0 1 0
\n
"
,
"6 1 0 0 1 0
\n
"
,
"7 1 0 0 1 0
\n
"
,
"8 1 0 0 1 0
\n
"
,
"9 0 1 0 0 1
\n
"
,
"10 0 1 0 0 1
\n
"
,
"11 0 1 0 0 1
\n
"
,
"12 0 1 0 0 1
\n
"
,
"13 0 1 0 0 1
\n
"
,
"
\n
"
,
"[14 rows x 21 columns]
\n
"
]
}
],
"source"
:
[
"X_test= tr[l1]
\n
"
,
"y_test = tr[[
\"
Prediction
\"
]]
\n
"
,
"np.ravel(y_test)
\n
"
,
"print(X_test)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
9
,
"id"
:
"a51d07e4"
,
"metadata"
:
{},
"outputs"
:
[
{
"name"
:
"stdout"
,
"output_type"
:
"stream"
,
"text"
:
[
" Prediction
\n
"
,
"0 0
\n
"
,
"1 0
\n
"
,
"2 0
\n
"
,
"3 0
\n
"
,
"4 1
\n
"
,
"5 1
\n
"
,
"6 1
\n
"
,
"7 1
\n
"
,
"8 1
\n
"
,
"9 2
\n
"
,
"10 2
\n
"
,
"11 2
\n
"
,
"12 2
\n
"
,
"13 2
\n
"
]
}
],
"source"
:
[
"print(y_test)"
]
},
{
"cell_type"
:
"markdown"
,
"id"
:
"d072b65e"
,
"metadata"
:
{},
"source"
:
[
"Random Forest Algorithm"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
10
,
"id"
:
"8c5e9d1f"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"root = Tk()
\n
"
,
"pred1=StringVar()
\n
"
,
"pred2=StringVar()
\n
"
,
"def randomforest():
\n
"
,
" if len(NameEn.get()) == 0:
\n
"
,
" pred1.set(
\"
\"
)
\n
"
,
" comp=messagebox.askokcancel(
\"
System
\"
,
\"
Please fill the breed of your pet!
\"
)
\n
"
,
" if comp:
\n
"
,
" root.mainloop()
\n
"
,
" elif((Symptom1.get()==
\"
Select Here
\"
) or (Symptom2.get()==
\"
Select Here
\"
)):
\n
"
,
" pred1.set(
\"
\"
)
\n
"
,
" sym=messagebox.askokcancel(
\"
System
\"
,
\"
Please fill atleast first two Symptoms
\"
)
\n
"
,
" if sym:
\n
"
,
" root.mainloop()
\n
"
,
" else:
\n
"
,
" from sklearn.ensemble import RandomForestClassifier
\n
"
,
" clf4 = RandomForestClassifier(n_estimators=100)
\n
"
,
" clf4 = clf4.fit(X,np.ravel(y))
\n
"
,
"
\n
"
,
" # calculating accuracy
\n
"
,
" from sklearn.metrics import classification_report,confusion_matrix,accuracy_score
\n
"
,
" y_pred=clf4.predict(X_test)
\n
"
,
" print(
\"
Random Forest
\"
)
\n
"
,
" print(
\"
Accuracy
\"
)
\n
"
,
" print(accuracy_score(y_test, y_pred))
\n
"
,
" print(accuracy_score(y_test, y_pred,normalize=False))
\n
"
,
" print(
\"
Confusion matrix
\"
)
\n
"
,
" conf_matrix=confusion_matrix(y_test,y_pred)
\n
"
,
" print(conf_matrix)
\n
"
,
"
\n
"
,
" psymptoms = [Symptom1.get(),Symptom2.get(),Symptom3.get(),Symptom4.get(),Symptom5.get(),Symptom6.get(),Symptom7.get()]
\n
"
,
"
\n
"
,
" for k in range(0,len(l1)):
\n
"
,
" for z in psymptoms:
\n
"
,
" if(z==l1[k]):
\n
"
,
" l2[k]=1
\n
"
,
"
\n
"
,
" inputtest = [l2]
\n
"
,
" predict = clf4.predict(inputtest)
\n
"
,
" predicted=predict[0]
\n
"
,
"
\n
"
,
" h='no'
\n
"
,
" for a in range(0,len(level)):
\n
"
,
" if(predicted == a):
\n
"
,
" h='yes'
\n
"
,
" break
\n
"
,
" if (h=='yes'):
\n
"
,
" pred2.set(
\"
\"
)
\n
"
,
" pred2.set(level[a])
\n
"
,
" else:
\n
"
,
" pred2.set(
\"
\"
)
\n
"
,
" pred2.set(
\"
Not Found
\"
)"
]
},
{
"cell_type"
:
"markdown"
,
"id"
:
"3d34149e"
,
"metadata"
:
{},
"source"
:
[
"Building Graphical User Interface"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
11
,
"id"
:
"99ed3abf"
,
"metadata"
:
{},
"outputs"
:
[
{
"data"
:
{
"text/plain"
:
[
"''"
]
},
"execution_count"
:
11
,
"metadata"
:
{},
"output_type"
:
"execute_result"
}
],
"source"
:
[
"#Tk class is used to create a root window
\n
"
,
"root.configure(background='Ivory')
\n
"
,
"root.title('Skin Disease Severity Level Predictor System')
\n
"
,
"root.resizable(0,0)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
12
,
"id"
:
"54176629"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"Symptom1 = StringVar()
\n
"
,
"Symptom1.set(
\"
Select Here
\"
)
\n
"
,
"
\n
"
,
"Symptom2 = StringVar()
\n
"
,
"Symptom2.set(
\"
Select Here
\"
)
\n
"
,
"
\n
"
,
"Symptom3 = StringVar()
\n
"
,
"Symptom3.set(
\"
Select Here
\"
)
\n
"
,
"
\n
"
,
"Symptom4 = StringVar()
\n
"
,
"Symptom4.set(
\"
Select Here
\"
)
\n
"
,
"
\n
"
,
"Symptom5 = StringVar()
\n
"
,
"Symptom5.set(
\"
Select Here
\"
)
\n
"
,
"
\n
"
,
"Symptom6 = StringVar()
\n
"
,
"Symptom6.set(
\"
Select Here
\"
)
\n
"
,
"
\n
"
,
"Symptom7 = StringVar()
\n
"
,
"Symptom7.set(
\"
Select Here
\"
)
\n
"
,
"Name = StringVar()"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
13
,
"id"
:
"4735241e"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"prev_win=None
\n
"
,
"def Reset():
\n
"
,
" global prev_win
\n
"
,
"
\n
"
,
" Symptom1.set(
\"
Select Here
\"
)
\n
"
,
" Symptom2.set(
\"
Select Here
\"
)
\n
"
,
" Symptom3.set(
\"
Select Here
\"
)
\n
"
,
" Symptom4.set(
\"
Select Here
\"
)
\n
"
,
" Symptom5.set(
\"
Select Here
\"
)
\n
"
,
" Symptom6.set(
\"
Select Here
\"
)
\n
"
,
" Symptom7.set(
\"
Select Here
\"
)
\n
"
,
" NameEn.delete(first=0,last=100)
\n
"
,
" pred1.set(
\"
\"
)
\n
"
,
" pred2.set(
\"
\"
)
\n
"
,
" try:
\n
"
,
" prev_win.destroy()
\n
"
,
" prev_win=None
\n
"
,
" except AttributeError:
\n
"
,
" pass"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
14
,
"id"
:
"c72bac2b"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"from tkinter import messagebox
\n
"
,
"def Exit():
\n
"
,
" qExit=messagebox.askyesno(
\"
System
\"
,
\"
Do you want to exit the system ?
\"
)
\n
"
,
"
\n
"
,
" if qExit:
\n
"
,
" root.destroy()
\n
"
,
" exit()"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
15
,
"id"
:
"fc2e6a16"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Heading
\n
"
,
"w2 = Label(root, justify=LEFT, text=
\"
Skin Disease Severity Level Prediction
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"w2.config(font=(
\"
Times
\"
,30,
\"
bold
\"
))
\n
"
,
"w2.grid(row=1, column=0, columnspan=2, padx=100)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
16
,
"id"
:
"e08d86c6"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Label - breed
\n
"
,
"NameLb = Label(root, text=
\"
Breed of the Pet *
\"
, fg=
\"
Dark Blue
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"NameLb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"NameLb.grid(row=6, column=0, pady=15, sticky=W)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
17
,
"id"
:
"7a538310"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Labels - symptoms
\n
"
,
"S1Lb = Label(root, text=
\"
Symptom 1 *
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"S1Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S1Lb.grid(row=7, column=0, pady=10, sticky=W)
\n
"
,
"
\n
"
,
"S2Lb = Label(root, text=
\"
Symptom 2 *
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"S2Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S2Lb.grid(row=8, column=0, pady=10, sticky=W)
\n
"
,
"
\n
"
,
"S3Lb = Label(root, text=
\"
Symptom 3
\"
, fg=
\"
Black
\"
,bg=
\"
Ivory
\"
)
\n
"
,
"S3Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S3Lb.grid(row=9, column=0, pady=10, sticky=W)
\n
"
,
"
\n
"
,
"S4Lb = Label(root, text=
\"
Symptom 4
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"S4Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S4Lb.grid(row=10, column=0, pady=10, sticky=W)
\n
"
,
"
\n
"
,
"S5Lb = Label(root, text=
\"
Symptom 5
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"S5Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S5Lb.grid(row=11, column=0, pady=10, sticky=W)
\n
"
,
"
\n
"
,
"S6Lb = Label(root, text=
\"
Symptom 6
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"S6Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S6Lb.grid(row=12, column=0, pady=10, sticky=W)
\n
"
,
"
\n
"
,
"S7Lb = Label(root, text=
\"
Symptom 7
\"
, fg=
\"
Black
\"
, bg=
\"
Ivory
\"
)
\n
"
,
"S7Lb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"S7Lb.grid(row=13, column=0, pady=10, sticky=W)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
18
,
"id"
:
"9c70874c"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Labels - algorithm
\n
"
,
"destreeLb = Label(root, text=
\"
RandomForest
\"
, fg=
\"
black
\"
, bg=
\"
Light blue
\"
, width = 20)
\n
"
,
"destreeLb.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"destreeLb.grid(row=15, column=0, pady=10, sticky=W)
\n
"
,
"OPTIONS = sorted(l1)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
19
,
"id"
:
"7046ac08"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Taking breed-name as input from user
\n
"
,
"NameEn = Entry(root, textvariable=Name)
\n
"
,
"NameEn.grid(row=6, column=1)
\n
"
,
"
\n
"
,
"#Taking Symptoms as input from the dropdown from the user
\n
"
,
"S1 = OptionMenu(root, Symptom1,*OPTIONS)
\n
"
,
"S1.grid(row=7, column=1)
\n
"
,
"
\n
"
,
"S2 = OptionMenu(root, Symptom2,*OPTIONS)
\n
"
,
"S2.grid(row=8, column=1)
\n
"
,
"
\n
"
,
"S3 = OptionMenu(root, Symptom3,*OPTIONS)
\n
"
,
"S3.grid(row=9, column=1)
\n
"
,
"
\n
"
,
"S4 = OptionMenu(root, Symptom4,*OPTIONS)
\n
"
,
"S4.grid(row=10, column=1)
\n
"
,
"
\n
"
,
"S5 = OptionMenu(root, Symptom5,*OPTIONS)
\n
"
,
"S5.grid(row=11, column=1)
\n
"
,
"
\n
"
,
"S6 = OptionMenu(root, Symptom6,*OPTIONS)
\n
"
,
"S6.grid(row=12, column=1)
\n
"
,
"
\n
"
,
"S7 = OptionMenu(root, Symptom7,*OPTIONS)
\n
"
,
"S7.grid(row=13, column=1)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
20
,
"id"
:
"fc8a3387"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Buttons
\n
"
,
"rnf = Button(root, text=
\"
Prediction
\"
, command=randomforest,bg=
\"
Blue
\"
,fg=
\"
yellow
\"
)
\n
"
,
"rnf.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"rnf.grid(row=6, column=3,padx=10)
\n
"
,
"
\n
"
,
"rs = Button(root,text=
\"
Reset Inputs
\"
, command=Reset,bg=
\"
yellow
\"
,fg=
\"
purple
\"
,width=12)
\n
"
,
"rs.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"rs.grid(row=10,column=3,padx=10)
\n
"
,
"
\n
"
,
"ex = Button(root,text=
\"
Exit System
\"
, command=Exit,bg=
\"
yellow
\"
,fg=
\"
purple
\"
,width=12)
\n
"
,
"ex.config(font=(
\"
Times
\"
,15,
\"
bold
\"
))
\n
"
,
"ex.grid(row=11,column=3,padx=10)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
21
,
"id"
:
"6f68b8b5"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#Showing the output
\n
"
,
"t2=Label(root,font=(
\"
Times
\"
,15,
\"
bold
\"
),text=
\"
Random Forest
\"
,height=1,bg=
\"
Light green
\"\n
"
,
" ,width=40,fg=
\"
black
\"
,textvariable=pred2,relief=
\"
sunken
\"
).grid(row=15, column=1, padx=10)"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
22
,
"id"
:
"2e41667b"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[
"#calling this function
\n
"
,
"root.mainloop()"
]
},
{
"cell_type"
:
"code"
,
"execution_count"
:
null
,
"id"
:
"f612b71c"
,
"metadata"
:
{},
"outputs"
:
[],
"source"
:
[]
}
],
"metadata"
:
{
"kernelspec"
:
{
"display_name"
:
"Python 3"
,
"language"
:
"python"
,
"name"
:
"python3"
},
"language_info"
:
{
"codemirror_mode"
:
{
"name"
:
"ipython"
,
"version"
:
3
},
"file_extension"
:
".py"
,
"mimetype"
:
"text/x-python"
,
"name"
:
"python"
,
"nbconvert_exporter"
:
"python"
,
"pygments_lexer"
:
"ipython3"
,
"version"
:
"3.8.8"
}
},
"nbformat"
:
4
,
"nbformat_minor"
:
5
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment