mlpack_cf(1)
π mlpack_cf β the collaborative filtering one π
okay bestie, sit down, hydrate, because you're about to meet mlpack_cf(1), a real one from the mlpack family. she does collaborative filtering and she does it well, no cap.
β¨ NAME β¨
mlpack_cf β collaborative filtering π
β¨ SYNOPSIS β¨
mlpack_cf [-a string] [-A bool] [-m unknown] [-i string] [-I bool] [-N int] [-r double] [-S string] [-n int] [-z string] [-q unknown] [-R int] [-c int] [-s int] [-T unknown] [-t unknown] [-V bool] [-o unknown] [-M unknown] [-h -v]
β¨ DESCRIPTION β¨
So like, this program performs collaborative filtering (CF) on the dataset you hand it. π«Ά You give it a list of user, item and preferences β that's the --training_file (-t) parameter β and she'll do a whole matrix decomposition, and then she can run a bunch of actions that are all about collaborative filtering. Obsessed.
Alternatively, she can load an existing saved CF model with the --input_model_file (-m) parameter and then use that model to give you recommendations or predict values. Lowkey the best way to reuse work.
The input matrix should be a 3-dimensional matrix of ratings, where:
- the first dimension is the user,
- the second dimension is the item,
- and the third dimension is that user's rating of that item.
Both the users and items should be numeric indices, not names, and the indices are assumed to start from 0. iykyk. π§
A set of query users for which recommendations can be generated may be specified with the --query_file (-q) parameter. Alternately, recommendations may be generated for every user in the dataset by specifying the --all_user_recommendations (-A) parameter. And on top of that? The number of recommendations per user to generate can be specified with the --recommendations (-c) parameter, and the number of similar users (aka the size of the neighborhood) to consider when generating recommendations can be specified with the --neighborhood (-n) parameter. it's giving fully customizable. π
πΈ the algorithm menu πΈ
For performing the matrix decomposition, the following optimization algorithms can be specified via the --algorithm (-a) parameter:
'RegSVD'β Regularized SVD using a SGD optimizer'NMF'β Non-negative matrix factorization with alternating least squares update rules'BatchSVD'β SVD batch learning'SVDIncompleteIncremental'β SVD incomplete incremental learning'SVDCompleteIncremental'β SVD complete incremental learning'BiasSVD'β Bias SVD using a SGD optimizer'SVDPP'β SVD++ using a SGD optimizer'RandSVD'β RandomizedSVD learning'QSVD'β QuicSVD learning'BKSVD'β Block Krylov SVD learning
π¦ neighbor search, interpolate, normalize π¦
The following neighbor search algorithms can be specified via the --neighbor_search (-S) parameter:
'cosine'β Cosine Search Algorithm'euclidean'β Euclidean Search Algorithm'pearson'β Pearson Search Algorithm
The following weight interpolation algorithms can be specified via the --interpolation (-i) parameter:
'average'β Average Interpolation Algorithm'regression'β Regression Interpolation Algorithm'similarity'β Similarity Interpolation Algorithm
The following ranking normalization algorithms can be specified via the --normalization (-z) parameter:
'none'β No Normalization'item_mean'β Item Mean Normalization'overall_mean'β Overall Mean Normalization'user_mean'β User Mean Normalization'z_score'β Z-Score Normalization
A trained model may be saved to with the --output_model_file (-M) output parameter. save ur work bestie, fr fr. πΎ
π the little examples that could π
To train a CF model on a dataset training_set.csv using NMF for decomposition and saving the trained model to model.bin, one could call:
$ mlpack_cf --training_file training_set.csv --algorithm NMF --output_model_file model.bin
Then, to use this model to generate recommendations for the list of users in the query set users.csv, storing 5 recommendations in recommendations.csv, one could call
$ mlpack_cf --input_model_file model.bin --query_file users.csv --recommendations 5 --output_file recommendations.csv
β¨ OPTIONAL INPUT OPTIONS β¨
okay this is the part where we go through EVERY single one, no skipping, because she has a lot and every single one matters π
--algorithm (-a)[string] β Algorithm used for matrix factorization. Default value'NMF'.--all_user_recommendations (-A)[bool] β Generate recommendations for all users.--help (-h)[bool] β Default help info.--info[string] β Print help on a specific option. Default value''.--input_model_file (-m)[unknown] β Trained CF model to load.--interpolation (-i)[string] β Algorithm used for weight interpolation. Default value'average'.--iteration_only_termination (-I)[bool] β Terminate only when the maximum number of iterations is reached.--max_iterations (-N)[int] β Maximum number of iterations. If set to zero, there is no limit on the number of iterations. Default value1000.--min_residue (-r)[double] β Residue required to terminate the factorization (lower values generally mean better fits). Default value1e-05.--neighbor_search (-S)[string] β Algorithm used for neighbor search. Default value'euclidean'.--neighborhood (-n)[int] β Size of the neighborhood of similar users to consider for each query user. Default value5.--normalization (-z)[string] β Normalization performed on the ratings. Default value'none'.--query_file (-q)[unknown] β List of query users for which recommendations should be generated.--rank (-R)[int] β Rank of decomposed matrices (if 0, a heuristic is used to estimate the rank). Default value0.--recommendations (-c)[int] β Number of recommendations to generate for each query user. Default value5.--seed (-s)[int] β Set the random seed (0 usesstd::time(NULL)). Default value0.--test_file (-T)[unknown] β Test set to calculate RMSE on.--training_file (-t)[unknown] β Input dataset to perform CF on.--verbose (-v)[bool] β Display informational messages and the full list of parameters and timers at the end of execution.--version (-V)[bool] β Display the version of mlpack.
β¨ OPTIONAL OUTPUT OPTIONS β¨
the "here's ur prize" section π
--output_file (-o)[unknown] β Matrix that will store output recommendations.--output_model_file (-M)[unknown] β Output for trained CF model.
β¨ ADDITIONAL INFORMATION β¨
For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack. go read, bestie, the lore is deep πβ¨
reminder of the day: every flag, every default, every path up there is exactly as written β copy them character for character, because the terminal does not do vibes-based error correction π
and that's a wrap, gorgeous πΈ this page came to you from mlpack-4.8.0, dated 22 June 2026 β mwah, slay, periodt π ππ¦
π¦ where this page comes from
- ubuntu stonking: mlpack-bin 4.8.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms