def trainset_classfeat_posclass(df, y=None, class_feat=None, pos_class=None):
    """ Process params into trainset, class feature name, and pos class, for use in .fit methods. """
    if y is None and class_feat is None:
        raise ValueError('y or class_feat argument is required')
    if y is not None and class_feat is not None and hasattr(y, 'name'
        ) and y.name != class_feat:
        raise ValueError(
            f'Value mismatch between params y {y.name} and class_feat {class_feat}. Besides, you only need to provide one of them.'
            )
    if class_feat is not None:
        class_feat = class_feat
    elif y is not None and hasattr(y, 'name'):
        class_feat = y.name
    else:
        class_feat = 'Class'
    if y is not None:
        df[class_feat] = y
    if pos_class is not None:
        pos_class = pos_class
    else:
        pos_class = df.iloc[0][class_feat]
    return df, class_feat, pos_class
