<jupyter_start><jupyter_text>PredictionI think the random forest model will do better because the ability to increase the n_estimators will help the model training<jupyter_code># Train the Logistic Regression model on the unscaled data and print the model score
classifier = LogisticRegression().fit(x_train, y_train)
print(f"Training Data Score: {classifier.score(x_train, y_train)}")
print(f"Testing Data Score: {classifier.score(x_test, y_test)}")
# Train a Random Forest Classifier model and print the model score
RFclassifier = RandomForestClassifier(random_state=1, n_estimators=25).fit(x_train, y_train)
print(f'Training Score: {RFclassifier.score(x_train, y_train)}')
print(f'Testing Score: {RFclassifier.score(x_test, y_test)}')<jupyter_output>Training Score: 0.9986863711001642
Testing Score: 0.6261165461505742<jupyter_text>Model ComparisionAs expected, the random forest model did better with both the training and testing score, tho it seems to be over fitting<jupyter_code># Scale the data
scaler = StandardScaler().fit(x_train)
x_train_scaled = scaler.transform(x_train)
x_test_scaled = scaler.transform(x_test)<jupyter_output><empty_output><jupyter_text>PredictionSince the random forest did better in the intial test, I think it will again do better than the logistic regression model.<jupyter_code># Train the Logistic Regression model on the scaled data and print the model score
scaled_classifier = LogisticRegression().fit(x_train_scaled, y_train)
print(f'Training Score: {scaled_classifier.score(x_train_scaled, y_train)}')
print(f'Testing Score: {scaled_classifier.score(x_test_scaled, y_test)}')
# Train a Random Forest Classifier model on the scaled data and print the model score
scaled_RFclassifier = RandomForestClassifier(random_state=1, n_estimators=25).fit(x_train_scaled, y_train)
print(f'Training Score: {scaled_RFclassifier.score(x_train_scaled, y_train)}')
print(f'Testing Score: {scaled_RFclassifier.score(x_test_scaled, y_test)}')<jupyter_output>Training Score: 0.9986863711001642
Testing Score: 0.6273925988940876
{'fraction_non_alphanumeric': 0.08532423208191127, 'fraction_numerical': 0.03607996099463676, 'mean_word_length': 8.588785046728972, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '481348', 'license': 'ADSL', 'n_tokens_mistral': 721, 'n_tokens_neox': 662, 'n_words': 185, 'path': 'Credit Risk Evaluator.ipynb', 'repo_name': 'Tania612/supervised-machine-learning', 'size': '2051'}