Skip to main content

eALS - Element-wise Alternating Least Squares

Project description

eALS - Element-wise Alternating Least Squares

A Python implementation of the element-wise alternating least squares (eALS) for fast online matrix factorization proposed by arXiv:1708.05024.

Prerequisites

  • Python >= 3.8

Installation

pip install eals

Usage

from eals import ElementwiseAlternatingLeastSquares, load_model

# Batch training
model = ElementwiseAlternatingLeastSquares()
model.fit(rating_data)

# Learned latent vectors
model.user_factors
model.item_factors

# Online training for new data
model.update_model(user_id, item_id)

# Save and load the model
model.save("model.joblib")
model = load_model("model.joblib")

See the examples directory for complete examples.

Development

Setup development environment

git clone https://github.com/newspicks/eals.git
cd eals
poetry run pip install -U pip
poetry install

Tests

poetry run pytest

Set USE_NUMBA=0 for faster testing without numba JIT overhead.

USE_NUMBA=0 poetry run pytest

To run tests against all supported Python versions, use tox.

poetry run tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eals-0.9.1.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

eals-0.9.1-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page