A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-recommend below:

The ML.RECOMMEND function | BigQuery

Stay organized with collections Save and categorize content based on your preferences.

The ML.RECOMMEND function

This document describes the ML.RECOMMEND function, which lets you generate a predicted rating for every user-item row combination for a matrix factorization model. Because the input data for a matrix factorization model tends to be a sparse matrix with missing values, ML.RECOMMEND can return the predictions for those missing values without requiring specification of each entry.

Note: ML.RECOMMEND can generate large outputs. Consider saving the output to a table for analysis. Syntax
ML.RECOMMEND(
  MODEL `PROJECT_ID.DATASET.MODEL_NAME`,
  [, { TABLE `PROJECT_ID.DATASET.TABLE` | (QUERY_STATEMENT) }]
  [, STRUCT(TRIAL_ID AS trial_id)])
Arguments

ML.RECOMMEND takes the following arguments:

Output

ML.RECOMMEND outputs at least 3 columns for all cases; the user column, the item column and a column for predicted recommendations.

The output of ML.RECOMMEND is computed as follows:

If the model was trained with feedback_type=EXPLICIT, a user column called user, and an item column called item, then ML.RECOMMEND returns the following columns:

If the model was trained with feedback_type=IMPLICIT, a user column called user, and an item column called item, then ML.RECOMMEND returns the following columns:

Examples

The following examples show how to use the ML.RECOMMEND function.

No input data

The following example generates predicted ratings for every user-item pair in the inputs of mymodel because there is no input data specified.

SELECT
  *
FROM
  ML.RECOMMEND(MODEL `mydataset.mymodel`)
With input data

The following example generates predicted ratings for each user-item row in mydataset.mytable assuming that mydataset.mymodel was trained using the user column user and item column item.

SELECT
  *
FROM
  ML.RECOMMEND(MODEL `mydataset.mymodel`,
      (
      SELECT
        user,
        item
      FROM
        `mydataset.mytable`))
What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["The `ML.RECOMMEND` function generates predicted ratings for user-item combinations using a matrix factorization model in BigQuery."],["It can predict missing values in sparse matrices without requiring each entry to be specified."],["The function can take an optional input table or query to filter or specify user-item combinations for predictions."],["Output includes at least three columns: `user`, `item`, and a column for predicted ratings or confidence levels, with the exact output depending on if the training was `EXPLICIT` or `IMPLICIT`."],["If no input data is specified, it outputs ratings for all user and item combinations present during training."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4