rel_acc

hhpy.ds.rel_acc(y_true: Union[pandas.core.series.Series, str], y_pred: Union[pandas.core.series.Series, str], df: pandas.core.frame.DataFrame = None, target_class: str = None)[source]

relative accuracy of the prediction in comparison to predicting everything as the most common group :param y_true: true values as name of df or vector data :param y_pred: predicted values as name of df or vector data :param df: pandas DataFrame containing true and predicted values [optional] :param target_class: name of the target class, by default the most common one is used [optional] :return: accuracy difference as percent