df_score

hhpy.ds.df_score(df: pandas.core.frame.DataFrame, y_true: Union[List[str], str], pred_suffix: list = None, scores: List[Callable] = None, pivot: bool = True, scale: Union[dict, list, int] = None, groupby: Union[list, str] = None) → pandas.core.frame.DataFrame[source]

creates a DataFrame displaying various kind of scores

Parameters:
  • df – pandas DataFrame containing the true, pred data
  • y_true – name of the true variable inside df
  • pred_suffix – name of the predicted variable suffixes. Supports multiple predictions. By default assumed suffix ‘pred’ [optional]
  • scores – scoring functions to be used [optional]
  • pivot – whether to pivot the DataFrame for easier readability [optional]
  • scale – a scale for multiplying the scores, default 1 [optional]
  • groupby – if supplied then the scores are calculated by group [optional]
Returns:

pandas DataFrame containing al the scores