lyst / lyst/lightfm

Feature formatting

Open
#616 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
5.1k
Forks
724
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am a building a lightFM model using interactions and feature metadata. The dataset feature contains numerical and categorical variable.

After doing some research (the documentation is not really clear on this), I choose to build my dataset as following:

- All possible values for features. Example: `{cat_feature1: [X, Y], cont_feature2: [10, 13] }`
- Feature values by item. Format: `a` & `b` are items.
`user_features_dense_formatted = [('a', {'cat_feature1:X': 1, 'cont_feature2': 10, ...}), ('b', {'cat_feature1:Y’: 1, 'cont_feature2': 13, ...}), ...]`

For numerical values, I understand that they are taken by the model as weights.

I have 3 questions:

- Is this the best way to format the side information feature data ?
- Since categorical variables are weights (either 0 or 1). Numerical values are weights (depending on the scale). What is the best way to scale the feature matrix ? There is a normalise option in `dataset.build_item_features(features_by_item, normalize= True) ` that sums feature values for each row to 1. However when I checked it is not true.
- Since we input feature data, does the model still include an identity matrix to represent item in the feature matrix ?
Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the documentation and the Dataset.build_item_features entry point mentioned in the issue. Verify the documented formats, normalization behavior, and whether identity features are included. Done means the documentation answers all three questions with clear examples and expected feature-matrix behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.