- changed samples to weighted

This commit is contained in:
ACK-J
2022-08-15 22:21:58 -04:00
parent 551bf1f458
commit e7a292e1d4
3 changed files with 3 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ def run_model(X_train, X_test, y_train, y_test, RANDOM_STATE, X_Validation, y_Va
# Metrics
print("GBC Metrics ")
y_pred = model.predict(X_test)
micro_f1 = f1_score(y_test, y_pred, average='samples')
micro_f1 = f1_score(y_test, y_pred, average='weighted')
print('avg F1-score: {:.2f}'.format(micro_f1))
#out_of_sample_f1.append(micro_f1)

View File

@@ -140,7 +140,7 @@ def MLP(X_train, X_test, y_train, y_test, X_Validation, y_Validation, stagenet=T
print("NN Metrics ")
y_pred = model.predict(X_test)
y_pred = np.argmax(y_pred, axis=1).tolist()
micro_f1 = f1_score(y_test_copy, y_pred, average='samples')
micro_f1 = f1_score(y_test_copy, y_pred, average='weighted')
print('Avg F1-score: {:.2f}'.format(micro_f1))
out_of_sample_f1.append(micro_f1)
if stagenet:

View File

@@ -50,7 +50,7 @@ def run_model_rf(X_train, X_test, y_train, y_test, RANDOM_STATE, X_Validation, y
# Metrics
print("Random Forest Metrics ")
y_pred = model.predict(X_test)
micro_f1 = f1_score(y_test, y_pred, average='samples')
micro_f1 = f1_score(y_test, y_pred, average='weighted')
print('avg F1-score: {:.2f}'.format(micro_f1))
#out_of_sample_f1.append(micro_f1)