class_docstr: Base `DataLoaders` for collaborative filtering.
class_docstr_tok: ["Base","`","DataLoaders","`","for","collaborative","filtering","."]
docstr: Create a `DataLoaders` suitable for collaborative filtering from `ratings`.
docstr_tok: ["Create","a","`","DataLoaders","`","suitable","for","collaborative","filtering","from","`","ratings","`","."]
code: def from_df(
      cls,
      ratings,
      valid_pct=0.2,
      user_name=None,
      item_name=None,
      rating_name=None,
      seed=None,
      path=".",
      **kwargs,
  ):
      "Create a `DataLoaders` suitable for collaborative filtering from `ratings`."
      user_name = ifnone(user_name, ratings.columns[0])
      item_name = ifnone(item_name, ratings.columns[1])
      rating_name = ifnone(rating_name, ratings.columns[2])
      cat_names = [user_name, item_name]
      splits = RandomSplitter(valid_pct=valid_pct, seed=seed)(
          range_of(ratings)
      )
      to = TabularCollab(
          ratings,
          [Categorify],
          cat_names,
          y_names=[rating_name],
          y_block=TransformBlock(),
          splits=splits,
      )
      return to.dataloaders(path=path, **kwargs)
  
file_path: fastai/fastai/collab.py
imports: from __future__ import annotations
  from .tabular.all import *
label_desc: Use image node_id 1 for calling the CollabDataLoaders obj's underlying member method code with example usage: obj.from_df(cls, ratings, valid_pct, user_name, item_name, rating_name, seed, path) and returns: to