Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run-time feature training for ALS #114

Closed
mdekstrand opened this issue Aug 6, 2019 · 2 comments · Fixed by #173 or #202
Closed

Add run-time feature training for ALS #114

mdekstrand opened this issue Aug 6, 2019 · 2 comments · Fixed by #173 or #202
Assignees
Labels
algorithms LensKit algorithm implementations
Milestone

Comments

@mdekstrand
Copy link
Member

The ALS algorithms are readily amenable to computing new or updated feature vectors for new users on the fly: just solve the least squares problem for the user's feature vector given their ratings and the item feature matrix.

We just need to write the code, and possibly factor out part of the solver to allow single-vector solutions. This is probably most robust with the LU-decomposition solver, although we could run the coordinate descent solver for a few rounds.

Unlike #60, this pertains to what we do at predict or recommend time, not updating the model itself.

@mdekstrand mdekstrand added this to the 0.8.0 milestone Aug 6, 2019
@mdekstrand mdekstrand added the algorithms LensKit algorithm implementations label Aug 6, 2019
@mdekstrand mdekstrand modified the milestones: 0.8.0, 0.9.0 Nov 6, 2019
@mdekstrand
Copy link
Member Author

mdekstrand commented May 19, 2020

We can do this by creating single-row versions of the LU decomposition code.

For example, for BiasMF, we could write a function:

def _train_bias_row_lu(items, ratings, other, reg):
    """
    Args:
        items(np.ndarray[i64]): the item IDs the user has rated
        ratings(np.ndarray): the user's (normalized) ratings for those items
        other(np.ndarray): the item-feature matrix
        reg(float): the regularization term

    Returns:
        np.ndarray: the user-feature vector (equivalent to V in the current LU code) 
    """
    pass

This function probably does not need to be accelerated with Numba.

@mdekstrand mdekstrand removed this from the 0.9.0 milestone May 21, 2020
mdekstrand added a commit that referenced this issue Aug 26, 2020
mdekstrand added a commit that referenced this issue Sep 18, 2020
Fix ALS run-time training (#114) for empty rating series
@mdekstrand
Copy link
Member Author

Re-opening because we still need to do ImplicitMF.

@mdekstrand mdekstrand reopened this Oct 8, 2020
@mdekstrand mdekstrand linked a pull request Nov 5, 2020 that will close this issue
mdekstrand added a commit that referenced this issue Nov 5, 2020
added new ratings for predict method in ImplicitMF (closes #114)
@mdekstrand mdekstrand added this to the 0.11.0 milestone Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
algorithms LensKit algorithm implementations
Projects
None yet
2 participants