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

feat: add support for creating a Matrix Factorization model #1330

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

rey-esp
Copy link
Contributor

@rey-esp rey-esp commented Jan 28, 2025

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Jan 28, 2025
bigframes/ml/decomposition.py Outdated Show resolved Hide resolved
bigframes/ml/decomposition.py Show resolved Hide resolved
bigframes/ml/decomposition.py Outdated Show resolved Hide resolved
bigframes/ml/decomposition.py Show resolved Hide resolved
bigframes/ml/decomposition.py Outdated Show resolved Hide resolved
@rey-esp rey-esp force-pushed the b338873783-matrix-factorization branch from 5f4f9d3 to e5165a9 Compare January 28, 2025 21:18
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Jan 28, 2025
@tswast tswast marked this pull request as ready for review January 29, 2025 17:25
@tswast tswast requested review from a team as code owners January 29, 2025 17:25
@tswast tswast requested a review from sycai January 29, 2025 17:25
Copy link
Contributor

@sycai sycai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to add some system/unit tests for this change?

Comment on lines +215 to +217
user_col: str,
item_col: str,
rating_col: str = "rating",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GarrettWu @shuoweil I see in #1282 you ended up passing in "id_col" as a separate argument to fit() instead of the class constructor. Is this a pattern you would recommend here?

Note: MatrixFactorization differs somewhat from that application in that normally in scikit-learn one would have a "sparse matrix" data type (e.g. https://docs.scipy.org/doc/scipy/reference/sparse.html) where rows/cols/values would all be bundled up in one object, similar to how we are using the bigframes DataFrame for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants