<jupyter_start><jupyter_text>DECISION TREE CLASSIFIER<jupyter_code>from sklearn.tree import DecisionTreeClassifier
dt_scores = []
for i in range(1, len(X.columns) + 1):
    dt_classifier = DecisionTreeClassifier(max_features = i, random_state = 0)
    dt_classifier.fit(X_train, y_train)
    dt_scores.append(dt_classifier.score(X_test, y_test))
plt.plot([i for i in range(1, len(X.columns) + 1)], dt_scores, color = 'green')
for i in range(1, len(X.columns) + 1):
    plt.text(i, dt_scores[i-1], (i, dt_scores[i-1]))
plt.xticks([i for i in range(1, len(X.columns) + 1)])
plt.xlabel('Max features')
plt.ylabel('Scores')
plt.title('Decision Tree Classifier scores for different number of maximum features')
from sklearn.metrics import accuracy_score
print("The score for Decision Tree Classifier is ",dt_scores[17]*100,"%")<jupyter_output>The score for Decision Tree Classifier is  100.0 %<jupyter_text>RANDOM FOREST<jupyter_code>from sklearn.ensemble import RandomForestClassifier
rf = RandomForestClassifier(n_estimators = 12, criterion='entropy', random_state =20)
rf.fit(X_train, y_train)

pred_ran=rf.predict(X_test)
accuracy_score(y_test,pred_ran)

print("The accuracy score for Random Forest Algorithm is ",accuracy_score(y_test,pred_ran)*100,"%")<jupyter_output>The accuracy score for Random Forest Algorithm is  100.0 %<jupyter_text>KNN<jupyter_code>from sklearn.neighbors import KNeighborsClassifier
knn_scores = []
for k in range(1,24):
    knn_classifier = KNeighborsClassifier(n_neighbors = k)
    knn_classifier.fit(X_train, y_train)
    #knn_scores.append(knn_classifier.score(X_test, y_test))
    pred=knn_classifier.predict(X_test)
    
from sklearn.metrics import accuracy_score
print("The accuracy score of KNN classifier is : ",accuracy_score(y_test,pred)*100,"%")
from sklearn.metrics import classification_report,confusion_matrix
print (classification_report(y_test,pred))
print (confusion_matrix(y_test,pred))<jupyter_output>precision    recall  f1-score   support

          0       1.00      0.40      0.57         5
          1       0.79      1.00      0.88        11

avg / total       0.85      0.81      0.78        16

[[ 2  3]
 [ 0 11]]
{'fraction_non_alphanumeric': 0.11029072450392248, 'fraction_numerical': 0.03553299492385787, 'mean_word_length': 4.781333333333333, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '190387', 'license': 'MIT', 'n_tokens_mistral': 835, 'n_tokens_neox': 767, 'n_words': 173, 'path': 'DISEASE CLASSIFIER(dropped null values).ipynb', 'repo_name': 'Budcoderr/Chronic-Kidney-Disease-Predictor', 'size': '2167'}