class_docstr: Base dot model for collaborative filtering.
class_docstr_tok: ["Base","dot","model","for","collaborative","filtering","."]
docstr: Build a model with `n_factors` by inferring `n_users` and  `n_items` from `classes`
docstr_tok: ["Build","a","model","with","`","n_factors","`","by","inferring","`","n_users","`","and","`","n_items","`","from","`","classes","`"]
code: def from_classes(
      cls, n_factors, classes, user=None, item=None, y_range=None
  ):
      "Build a model with `n_factors` by inferring `n_users` and  `n_items` from `classes`"
      if user is None:
          user = list(classes.keys())[0]
      if item is None:
          item = list(classes.keys())[1]
      res = cls(
          n_factors,
          len(classes[user]),
          len(classes[item]),
          y_range=y_range,
      )
      res.classes, res.user, res.item = classes, user, item
      return res
  
file_path: fastai/fastai/collab.py
imports: from __future__ import annotations
  from .tabular.all import *
label_desc: Use image node_id 3 for calling the EmbeddingDotBias obj's underlying member method code with example usage: obj.from_classes(cls, n_factors, classes, user, item, y_range) and returns: res