1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Why is my ALS model suggesting such a high alpha value?

Discussão em 'Python' iniciado por Stack, Setembro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I implemented a recommender system using Ben Fred’s implicit library.

    Preprocessing steps I applied:

    1. Removed all users with 200+ interactions per day (likely bots or employees).
    2. Removed all users with fewer than 2 interactions.
    3. Removed all products with fewer than 3 interactions.
    4. Assigned different weights per interaction type:
      INTERACTION_WEIGHTS = {
      'purchase': 1.0,
      'initiate_checkout': 0.7,
      'add_to_cart': 0.5,
      'add_to_wishlist': 0.3,
      'content_view': 0.1
      }
    5. Applied time-decay weighting so that recent interactions count more.
    6. Used different decay scales for each interaction type.

    Dataset stats:

    • Number of users: 97,793
    • Number of products: 32,943
    • Number of non-zero interactions: 366,931
    • Density: 0.00011390

    Quantiles of weights:

    • 0%: 0.0000
    • 25%: 0.0000
    • 50%: 0.0000
    • 75%: 0.0027
    • 100%: 13.5251

    Training loss:

    0.000003
    ...
    0.000002


    Interaction distribution: [​IMG]

    Model configuration:


    Default ALS hyperparams:

    factors=100
    regularization=0.01
    alpha=1.0


    My "tuned" model:

    model = implicit.als.AlternatingLeastSquares(
    factors=550,
    regularization=0.01,
    alpha=2.0,
    iterations=25,
    calculate_training_loss=True
    )

    The issue


    When running hyperparameter tuning with my scoring method, the best performing alpha comes out around 140.0.

    My concern:

    • This seems extremely high compared to the default alpha=1.0.
    • It makes me think something might be wrong with my preprocessing, weighting, or evaluation setup.

    Evaluation metric: I use a weighted scoring function that combines several ranking metrics:

    score = (
    0.3 * precision_10 +
    0.25 * precision_5 +
    0.2 * auc_10 +
    0.15 * map_10 +
    0.1 * ndcg_10
    )


    Question:

    • Is it normal for alpha to need to be set so high in an implicit ALS setup?
    • Could this be an artifact of my interaction weighting or density?
    • Or does it indicate a problem in how I’ve structured my dataset or evaluation pipeline?

    Continue reading...

Compartilhe esta Página