<jupyter_start><jupyter_text>Train> You can use this module to train your models required for recommendation. In order to create an instance of the Recommender class of the core module, you will need to create an artist learner and a playlist learner.<jupyter_code>#export
from fastai.collab import *
from fastai.tabular.all import *
#export
def train(dataframe, item_name, lr=5e-3, cycles=1):
    dls = CollabDataLoaders.from_df(dataframe, item_name=item_name, bs=64)
    learn = collab_learner(dls, n_factors=50, y_range=(0,1.5))
    learn.fit_one_cycle(cycles, lr)
    return learn
#export
def export_learner(learn, path, fname):
    learn.path = path
    learn.export(fname=fname)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09103641456582633, 'fraction_numerical': 0.014005602240896359, 'mean_word_length': 5.441441441441442, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '228188', 'license': 'Apache-2.0', 'n_tokens_mistral': 250, 'n_tokens_neox': 243, 'n_words': 71, 'path': '01_train.ipynb', 'repo_name': 'daniel-riffi/flowsy', 'size': '714'}