Created
May 19, 2019 23:10
-
-
Save robotenique/28cbffce97e140974c19f246fe28781b 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.metrics.pd_extractors import * | |
eval_auc_col = "auc_evaluator__sentiment" | |
eval_logloss_col = "logloss_evaluator__sentiment" | |
eval_precision_col = "precision_evaluator__sentiment" | |
eval_recall_col = "recall_evaluator__sentiment" | |
base_extractor = combined_evaluator_extractor(base_extractors=[evaluator_extractor(evaluator_name=eval_auc_col), | |
evaluator_extractor(evaluator_name=eval_logloss_col), | |
evaluator_extractor(evaluator_name=eval_precision_col), | |
evaluator_extractor(evaluator_name=eval_recall_col)]) | |
# Create a split evaluator based on the publication date available for a df_evaluation dataframe | |
def create_year_week_extractor(df_evaluation): | |
year_week_splits = sorted((k.replace("split_evaluator__publication_date_", "") for k in df_evaluation.keys() if "publication_date" in k)) | |
return split_evaluator_extractor(split_col="publication_date", split_values=year_week_splits, base_extractor=base_extractor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment