class_docstr: Integration with the lightfm Recommender library.
code: def create(
      self,
      target: str,
      df: pd.DataFrame = None,
      args: Optional[Dict] = None,
  ):
      args = args["using"]
  
      # get model parameters if defined by user - else use default values
  
      user_defined_model_params = list(
          filter(
              lambda x: x in args, ["learning_rate", "loss", "epochs"]
          )
      )
      args["model_params"] = {
          model_param: args[model_param]
          for model_param in user_defined_model_params
      }
      model_parameters = ModelParameters(**args["model_params"])
  
      # store model parameters
      args["model_params"] = model_parameters.dict()
  
      rec_preprocessor = RecommenderPreprocessor(
          interaction_data=df,
          user_id_column_name=args["user_id"],
          item_id_column_name=args["item_id"],
          threshold=args["threshold"],
      )
  
      # preprocess data
      preprocessed_data = rec_preprocessor.preprocess()
  
      args["n_users_items"] = rec_preprocessor.n_users_items
  
      # get item idx to id and user idx to id maps
      args["item_idx_to_id_map"] = preprocessed_data.idx_item_map
      args["user_idx_to_id_map"] = preprocessed_data.idx_user_map
  
      random_state = 42
  
      # run evaluation if specified
      if args.get("evaluation"):
          evaluation_metrics = self.evaluate(
              preprocessed_data.interaction_matrix,
              random_state,
              model_parameters,
          )
          # convert to float to str so it can be stored in json
          args["evaluation_metrics"] = {
              k: str(v) for k, v in evaluation_metrics.items()
          }
  
      # train model
      model = LightFM(
          learning_rate=model_parameters.learning_rate,
          loss=model_parameters.loss,
          random_state=random_state,
      )
      model.fit(
          preprocessed_data.interaction_matrix,
          epochs=model_parameters.epochs,
      )
  
      self.model_storage.file_set("model", dill.dumps(model))
      self.model_storage.json_set("args", args)
  
file_path: mindsdb/mindsdb/integrations/handlers/lightfm_handler/lightfm_handler.py
imports: from typing import Dict, Optional
  import dill
  import pandas
  from dataprep_ml.recommenders import RecommenderPreprocessor
  from lightfm import LightFM
  from lightfm.cross_validation import random_train_test_split
  from lightfm.evaluation import auc_score, precision_at_k, recall_at_k
  from mindsdb.integrations.handlers.lightfm_handler.helpers import get_item_item_recommendations, get_user_item_recommendations
  from mindsdb.integrations.handlers.lightfm_handler.settings import ModelParameters
  from mindsdb.integrations.libs.base import BaseMLEngine
label_desc: Use image node_id 1 for calling the LightFMHandler obj's underlying member method code with example usage: obj.create(target, df, args) without return types