mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-27 18:57:55 +00:00
feat(Core): added the first classification model & the feature necessary (#4)
* feat(Core): added the first classification model & the feature necessary * feat(Models): added basic transformers model
This commit is contained in:
committed by
GitHub
parent
797791d2f4
commit
1d6eed3a94
+8
-4
@@ -1,9 +1,13 @@
|
||||
from math import sqrt
|
||||
from sklearn.metrics import mean_squared_error, mean_absolute_error
|
||||
|
||||
def print_metrics(y_true, y_pred):
|
||||
from sklearn.metrics import mean_squared_error, mean_absolute_error, accuracy_score
|
||||
from sklearn.metrics import confusion_matrix
|
||||
def print_regression_metrics(y_true, y_pred):
|
||||
rmse = sqrt(mean_squared_error(y_true, y_pred))
|
||||
print("RMSE: %.2f" % rmse)
|
||||
|
||||
mae = mean_absolute_error(y_true, y_pred)
|
||||
print("MAE: %.2f" % mae)
|
||||
print("MAE: %.2f" % mae)
|
||||
|
||||
def print_classification_metrics(y_true, y_pred):
|
||||
print("Accuracy: %.2f" % accuracy_score(y_true, y_pred))
|
||||
print("Confusion Matrix: \n", confusion_matrix(y_true, y_pred))
|
||||
Reference in New Issue
Block a user