Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms.py has disease list #24

Merged
merged 1 commit into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion forms.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField, SelectField, IntegerField, TextAreaField, RadioField
from wtforms.validators import DataRequired
from Disease import list_column_names

column_names = list_column_names("dataset/Training.csv")
class DiseaseDetailsForm(FlaskForm):
pass
name = StringField("Name", validators=[DataRequired()])
disease_list = SelectField("Disease", choices=[(column_name, column_name) for column_name in column_names])
submit = SubmitField("Submit")

class PatientDetailsForm(FlaskForm):

pass

class LoginUserForm(FlaskForm):
Expand Down
Empty file added templates/camera.html
Empty file.
7 changes: 1 addition & 6 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
plt.figure(figsize = (18,8))
sns.barplot(x = "Disease", y = "Counts", data = temp_df)
plt.xticks(rotation=90)
plt.show()

# Encoding the target value into numerical
# value using LabelEncoder
Expand Down Expand Up @@ -77,7 +76,6 @@ def cv_scoring(estimator, X, y):
plt.figure(figsize=(12,8))
sns.heatmap(cf_matrix, annot=True)
plt.title("Confusion Matrix for SVM Classifier on Test Data")
plt.show()

# Training and testing Naive Bayes Classifier
nb_model = GaussianNB()
Expand All @@ -92,7 +90,6 @@ def cv_scoring(estimator, X, y):
plt.figure(figsize=(12,8))
sns.heatmap(cf_matrix, annot=True)
plt.title("Confusion Matrix for Naive Bayes Classifier on Test Data")
plt.show()

# Training and testing Random Forest Classifier
rf_model = RandomForestClassifier(random_state=18)
Expand All @@ -108,7 +105,6 @@ def cv_scoring(estimator, X, y):
plt.figure(figsize=(12,8))
sns.heatmap(cf_matrix, annot=True)
plt.title("Confusion Matrix for Random Forest Classifier on Test Data")
plt.show()

# Training the models on whole data
final_svm_model = SVC()
Expand Down Expand Up @@ -141,7 +137,6 @@ def cv_scoring(estimator, X, y):

sns.heatmap(cf_matrix, annot = True)
plt.title("Confusion Matrix for Combined Model on Test Dataset")
plt.show()

symptoms = X.columns.values

Expand Down Expand Up @@ -189,5 +184,5 @@ def predictDisease(symptoms):
return predictions

# Testing the function
print(predictDisease("Itching,Skin Rash,Nodal Skin Eruptions"))
print(predictDisease("Blister,Red Sore Around Nose,Yellow Crust Ooze"))