Download the PHP package ankane/libmf without Composer
On this page you can find all versions of the php package ankane/libmf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package libmf
Short Description Large-scale sparse matrix factorization for PHP
License BSD-3-Clause
Informations about the package libmf
LIBMF PHP
LIBMF - large-scale sparse matrix factorization - for PHP
Check out Disco for higher-level collaborative filtering
Installation
Run:
Add scripts to composer.json
to download the shared library:
And run:
Getting Started
Prep your data in the format rowIndex, columnIndex, value
Create a model
Make predictions
Get the latent factors (these approximate the training matrix)
Get the bias (average of all elements in the training matrix)
Save the model to a file
Load the model from a file
Pass a validation set
Cross-Validation
Perform cross-validation
Specify the number of folds
Parameters
Pass parameters - default values below
Loss Functions
For real-valued matrix factorization
Loss::RealL2
- squared error (L2-norm)Loss::RealL1
- absolute error (L1-norm)Loss::RealKL
- generalized KL-divergence
For binary matrix factorization
Loss::BinaryLog
- logarithmic errorLoss::BinaryL2
- squared hinge lossLoss::BinaryL1
- hinge loss
For one-class matrix factorization
Loss::OneClassRow
- row-oriented pair-wise logarithmic lossLoss::OneClassCol
- column-oriented pair-wise logarithmic lossLoss::OneClassL2
- squared error (L2-norm)
Metrics
Calculate RMSE (for real-valued MF)
Calculate MAE (for real-valued MF)
Calculate generalized KL-divergence (for non-negative real-valued MF)
Calculate logarithmic loss (for binary MF)
Calculate accuracy (for binary MF)
Calculate MPR (for one-class MF)
Calculate AUC (for one-class MF)
Example
Download the MovieLens 100K dataset and use:
Resources
History
View the changelog
Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
All versions of libmf with dependencies
ext-ffi Version >= 8.1