Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 56-remove-sklearn
Browse files Browse the repository at this point in the history
  • Loading branch information
dobraczka committed Dec 15, 2022
2 parents 48d0ac4 + ce492dd commit a7caa1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rexmex/scorecard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Collection, List, Mapping, Tuple
from typing import Collection, List, Mapping, Optional, Tuple

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -35,7 +35,7 @@ def get_performance_metrics(self, y_true: np.array, y_score: np.array) -> pd.Dat
performance_metrics_df = pd.DataFrame.from_dict(performance_metrics)
return performance_metrics_df

def generate_report(self, scores_to_evaluate: pd.DataFrame, grouping: List[str] = None) -> pd.DataFrame:
def generate_report(self, scores_to_evaluate: pd.DataFrame, grouping: Optional[List[str]] = None) -> pd.DataFrame:
"""
A method to calculate (aggregated) performance metrics based
on a dataframe of ground truth and predictions. It assumes that the dataframe has the `y_true`
Expand Down Expand Up @@ -129,7 +129,7 @@ def get_coverage_metrics(self, recommendations: List[Tuple]) -> pd.DataFrame:
performance_metrics_df = pd.DataFrame.from_dict(performance_metrics)
return performance_metrics_df

def generate_report(self, recs_to_evaluate: pd.DataFrame, grouping: List[str] = None) -> pd.DataFrame:
def generate_report(self, recs_to_evaluate: pd.DataFrame, grouping: Optional[List[str]] = None) -> pd.DataFrame:
"""
A method to calculate (aggregated) coverage/performance metrics based on a dataframe of predictions.
It assumes that the dataframe has the `user` and `item` keys in the dataframe.
Expand Down

0 comments on commit a7caa1f

Please sign in to comment.