recpack.preprocessing.filters.MinRating
- class recpack.preprocessing.filters.MinRating(min_rating: int, rating_ix: str)
Keep ratings above or equal to min_rating. This filter is used to turn a rating dataset into an interaction dataset.
After filtering, the rating_ix column will also be removed from the DataFrame.
- Parameters
min_rating (int) – The minimum rating for a rating to be considered an interaction.
rating_ix – The column that contains ratings in the DataFrame.
Methods
apply
(df)Apply Filter to the DataFrame passed.
apply_all
(*dfs)Apply the filter to a list of pandas DataFrames.
- apply(df)
Apply Filter to the DataFrame passed.
- Parameters
df (pd.DataFrame) – DataFrame to filter
- apply_all(*dfs: pandas.core.frame.DataFrame) List[pandas.core.frame.DataFrame]
Apply the filter to a list of pandas DataFrames.
The filter is applied independently to each of the DataFrames.
- Returns
The list of processed DataFrames
- Return type
List[pd.DataFrame]