Created
May 19, 2019 22:38
-
-
Save robotenique/a892a1dc4e9465484189e9ed1481fa8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fklearn.validation.evaluators import auc_evaluator, logloss_evaluator, precision_evaluator, recall_evaluator, \ | |
combined_evaluators, temporal_split_evaluator | |
def tweet_eval(target_column, prediction_column, time_column): | |
eval_args = dict(target_column=target_column, prediction_column=prediction_column) | |
basic_evaluator = combined_evaluators(evaluators=[ | |
auc_evaluator(**eval_args), | |
logloss_evaluator(**eval_args), | |
precision_evaluator(**eval_args), | |
recall_evaluator(**eval_args) | |
]) | |
final_evaluator = combined_evaluators(evaluators=[ | |
basic_evaluator, | |
temporal_split_evaluator(eval_fn=basic_evaluator, time_col=time_column, time_format="%Y-%U") # Weekly | |
]) | |
return final_evaluator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment