Skip to content

Cornac Baselines

S.Saman .E edited this page Jul 15, 2026 · 1 revision

Available models

Repository identifier Model Primary objective
cornac_mf Matrix Factorization Pointwise rating prediction
cornac_pmf Probabilistic Matrix Factorization Probabilistic rating prediction
cornac_bpr Bayesian Personalized Ranking Pairwise ranking
cornac_wmf Weighted Matrix Factorization Implicit-feedback reconstruction
cornac_itemknn Item K-Nearest Neighbors Item-similarity recommendation
cornac_mlp Multi-Layer Perceptron Nonlinear interaction learning

Run all Cornac baselines

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models \
        cornac_pmf \
        cornac_bpr \
        cornac_itemknn \
        cornac_mf \
        cornac_wmf \
        cornac_mlp

This command uses the default parameters defined in:

config/model_search_spaces.yml

Run all Cornac baselines with Bayesian optimization

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --use_bo \
    --models \
        cornac_pmf \
        cornac_bpr \
        cornac_itemknn \
        cornac_mf \
        cornac_wmf \
        cornac_mlp

Run individual models

Matrix Factorization

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models cornac_mf

With Bayesian optimization:

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --use_bo \
    --models cornac_mf

Probabilistic Matrix Factorization

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models cornac_pmf

Bayesian Personalized Ranking

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models cornac_bpr

Weighted Matrix Factorization

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models cornac_wmf

Item K-Nearest Neighbors

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models cornac_itemknn

Multi-Layer Perceptron

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models cornac_mlp

Compare Cornac models with RC-MF

RC-MF versus Cornac MF

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models rc_mf cornac_mf

RC-MF versus PMF and BPR

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models rc_mf cornac_pmf cornac_bpr

Full comparison

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --models \
        rc_mf \
        cornac_pmf \
        cornac_bpr \
        cornac_itemknn \
        cornac_mf \
        cornac_wmf \
        cornac_mlp

Full comparison with Bayesian optimization

python experiment_runner.py \
    --dataset Beauty \
    --epochs 100 \
    --seed 0 \
    --use_bo \
    --models \
        rc_mf \
        cornac_pmf \
        cornac_bpr \
        cornac_itemknn \
        cornac_mf \
        cornac_wmf \
        cornac_mlp

Run multiple seeds

for seed in 0 1 2 3 4 5 6 7 8 9
do
    python experiment_runner.py \
        --dataset Beauty \
        --epochs 100 \
        --seed "$seed" \
        --models \
            cornac_pmf \
            cornac_bpr \
            cornac_itemknn \
            cornac_mf \
            cornac_wmf \
            cornac_mlp
done

For a full RC-MF and Cornac comparison:

for seed in 0 1 2 3 4 5 6 7 8 9
do
    python experiment_runner.py \
        --dataset Beauty \
        --epochs 100 \
        --seed "$seed" \
        --models \
            rc_mf \
            cornac_pmf \
            cornac_bpr \
            cornac_itemknn \
            cornac_mf \
            cornac_wmf \
            cornac_mlp
done

Evaluation protocol

For each dataset and seed:

  • one train-test split is generated;
  • all models use the same training observations;
  • all models are evaluated on the same test observations;
  • hyperparameter selection uses training data only;
  • the test data are not used during Bayesian optimization;
  • regression and ranking metrics are computed by the same evaluator.

Rating-prediction metrics

The runner reports:

  • RMSE;
  • MSE;
  • MAE;
  • (R^2).

Lower RMSE, MSE, and MAE indicate better prediction accuracy.

Ranking metrics

When the model supports candidate-item scoring, the runner reports:

  • Precision@5, @10, and @20;
  • Recall@5, @10, and @20;
  • NDCG@5, @10, and @20.