Skip to content

Commit

Permalink
Merge pull request #161 from KOSASIH/deepsource-transform-1729feab
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 12, 2024
2 parents 15cd974 + 4c7e1fc commit ed47d6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion transaction_management/model_evaluation.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import pandas as pd
from sklearn.metrics import classification_report, confusion_matrix


def evaluate_transaction_model_performance(model, X_test, y_test):
"""
Evaluates the performance of the trained transaction machine learning model using various metrics.
"""
y_pred = model.predict(X_test)
report = classification_report(y_test, y_pred)
matrix = confusion_matrix(y_test, y_pred)
df = pd.DataFrame(matrix, columns=['Predicted No', 'Predicted Yes'], index=['Actual No', 'Actual Yes'])
df = pd.DataFrame(
matrix,
columns=["Predicted No", "Predicted Yes"],
index=["Actual No", "Actual Yes"],
)
return report, df

0 comments on commit ed47d6e

Please sign in to comment.