recommenders-team/recommenders

[ASK] LibffmConverter - are the fit and transform function similar to Sklearn function such as OrdinalEncoder?

Open

#1,818 建立於 2022年9月14日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Python (2,972 fork)batch import
help wanted

倉庫指標

Star
 (17,706 star)
PR 合併指標
 (平均合併 6天 16小時) (30 天內合併 10 個 PR)

描述

Description

I am splitting my dataset into Train, Validation, Test dataset.

For sklearn, when using OrdinalEncoder, the fit function will only be performed on Train dataset, I can use the same OrdinalEncoder fitted object to transform on unseen data(in this case Validation and Test dataset) without fitting again, this will preserve the same encoding and unseen data will be encoded as -1.

Does LibffmConverter perform the same way by simply fitting only the Train dataset and I can use the fitted object to transform other unseen(Validation and Test) dataset?

Example: converter = LibffmConverter().fit(train_df, col_rating='rating') train_df_new = converter.transform(train_df)

valid_df_new = converter.transform(valid_df). # preserving train fitted dictionary mapping and handle unseen data? 
test_df_new = converter.transform(test_df). # preserving train fitted dictionary mapping and handle unseen data?

貢獻者指南