本頁面中的部分或全部資訊可能不適用於 Trusted Cloud by S3NS。
迴歸總覽
機器學習的常見用途,就是使用以類似歷史資料訓練的模型,預測新資料的數值指標值。舉例來說,您可能想預測房屋的預期售價。您可以將房屋的位置和特徵做為特徵,將這間房屋與已售出的類似房屋進行比較,並根據這些房屋的售價來估算房屋的售價。
您可以搭配使用下列任一模型和 ML.PREDICT
函式執行迴歸:
建議的知識
只要使用 CREATE MODEL
陳述式和 ML.PREDICT
函式中的預設設定,即使沒有太多機器學習知識,也能建立及使用迴歸模型。不過,瞭解機器學習開發的基本知識,有助您最佳化資料和模型,進而獲得更優異的結果。建議您參考下列資源,熟悉機器學習技術和程序:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-17 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-17 (世界標準時間)。"],[[["\u003cp\u003eRegression models are used to predict numerical values for new data based on patterns learned from historical data, such as predicting a house's sale price.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eML.PREDICT\u003c/code\u003e function can be used in conjunction with various models, including linear regression, boosted tree, random forest, deep neural network (DNN), wide & deep, and AutoML models, to perform regression.\u003c/p\u003e\n"],["\u003cp\u003eYou can create and use a regression model with default settings without extensive machine learning (ML) knowledge, though basic ML familiarity can help improve results.\u003c/p\u003e\n"],["\u003cp\u003eSeveral resources like Google's Machine Learning Crash Course and Kaggle's ML tutorials are available to help build familiarity with ML techniques and processes.\u003c/p\u003e\n"]]],[],null,["# Regression overview\n===================\n\nA common use case for machine learning is predicting the value of a numerical\nmetric for new data by using a model trained on similar historical data.\nFor example, you might want to predict a house's expected sale price. By using\nthe house's location and characteristics as features, you can compare this house\nto similar houses that have already sold, and use their sales prices to estimate\nthe house's sale price.\n\nYou can use any of the following models in combination with the\n[`ML.PREDICT` function](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-predict)\nto perform regression:\n\n- [Linear regression models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-glm): use [linear regression](https://developers.google.com/machine-learning/crash-course/linear-regression) by setting the `MODEL_TYPE` option to `LINEAR_REG`.\n- [Boosted tree models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-boosted-tree): use a [gradient boosted decision tree](https://developers.google.com/machine-learning/decision-forests/intro-to-gbdt) by setting the `MODEL_TYPE` option to `BOOSTED_TREE_REGRESSOR`.\n- [Random forest models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-random-forest): use a [random forest](https://developers.google.com/machine-learning/decision-forests/intro-to-decision-forests) by setting the `MODEL_TYPE` option to `RANDOM_FOREST_REGRESSOR`.\n- [Deep neural network (DNN) models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-dnn-models): use a [neural network](https://developers.google.com/machine-learning/crash-course/neural-networks) by setting the `MODEL_TYPE` option to `DNN_REGRESSOR`.\n- [Wide \\& Deep models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-wnd-models): use [wide \\& deep learning](https://dl.acm.org/doi/10.1145/2988450.2988454) by setting the `MODEL_TYPE` option to `DNN_LINEAR_COMBINED_REGRESSOR`.\n- [AutoML models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-automl): use an [AutoML classification model](/vertex-ai/docs/tabular-data/classification-regression/overview) by setting the `MODEL_TYPE` option to `AUTOML_REGRESSOR`.\n\nRecommended knowledge\n---------------------\n\nBy using the default settings in the `CREATE MODEL` statements and the\n`ML.PREDICT` function, you can create and use a regression model even\nwithout much ML knowledge. However, having basic knowledge about\nML development helps you optimize both your data and your model to\ndeliver better results. We recommend using the following resources to develop\nfamiliarity with ML techniques and processes:\n\n- [Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course)\n- [Intro to Machine Learning](https://www.kaggle.com/learn/intro-to-machine-learning)\n- [Intermediate Machine Learning](https://www.kaggle.com/learn/intermediate-machine-learning)"]]