<jupyter_start><jupyter_text>There is a room for improvement. Since the data was imbalanced, accuracy score is just 78%. Let's try balancing data and then apply Decision Tree Classifier and see the difference!<jupyter_code>from imblearn.combine import SMOTEENN
smoteen = SMOTEENN()
X_smotee, Y_smotee = smoteen.fit_resample(X,Y)
X_retrain, X_retest, Y_retrain, Y_retest = train_test_split(X_smotee, Y_smotee, test_size= 0.33)
new_model = DecisionTreeClassifier(criterion='gini', max_depth=6, random_state=100, min_samples_leaf=8)
new_model.fit(X_retrain, Y_retrain)
Y_repred=new_model.predict(X_retest)
new_score = new_model.score(X_retest, Y_retest)
new_score
new_class_report = classification_report(y_true= Y_retest, y_pred= Y_repred, labels=[0,1])

print(new_class_report)<jupyter_output>precision    recall  f1-score   support

           0       0.91      0.91      0.91       872
           1       0.93      0.93      0.93      1092

    accuracy                           0.92      1964
   macro avg       0.92      0.92      0.92      1964
weighted avg       0.92      0.92      0.92      1964<jupyter_text>Clearly quite an improvement!<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07983193277310924, 'fraction_numerical': 0.06134453781512605, 'mean_word_length': 3.2841726618705036, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '326578', 'license': 'Apache-2.0', 'n_tokens_mistral': 473, 'n_tokens_neox': 426, 'n_words': 96, 'path': 'Decision_tree_model.ipynb', 'repo_name': 'RitujaPawas/ChurnAnalysis', 'size': '1190'}