本页面上的部分或全部信息可能不适用于 Trusted Cloud by S3NS。
重合概览
聚类是一种非监督式机器学习技术,可用于将相似的记录归为一组。如果您想要了解数据中存在哪些组或簇,但没有标记数据来训练模型,则此方法非常有用。例如,如果您有关于地铁票购买交易的未标记数据,则可以按票券购买时间对这些数据进行分组,以便更好地了解地铁使用量最高的时间段。如需了解详情,请参阅什么是重合?
K-means 模型广泛用于执行聚类。您可以将 K-means 模型与 ML.PREDICT
函数搭配使用来对数据进行聚类,也可以与 ML.DETECT_ANOMALIES
函数搭配使用来执行异常值检测。
K-means 模型使用基于质心的聚类将数据整理成多个聚类。如需获取有关 k-means 模型中心点的信息,您可以使用 ML.CENTROIDS
函数。
推荐的知识
通过使用 CREATE MODEL
语句和推理函数中的默认设置,即使您没有太多机器学习方面的知识,也可以创建和使用聚类模型。不过,具备机器学习开发(尤其是聚类模型)方面的基本知识有助于您优化数据和模型,从而获得更好的结果。我们建议您使用以下资源熟悉机器学习技术和流程:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eClustering is an unsupervised machine learning technique that groups similar records together, useful for understanding data patterns without labeled training data.\u003c/p\u003e\n"],["\u003cp\u003eK-means models, a widely used clustering method, can be used with \u003ccode\u003eML.PREDICT\u003c/code\u003e to cluster data or with \u003ccode\u003eML.DETECT_ANOMALIES\u003c/code\u003e for anomaly detection.\u003c/p\u003e\n"],["\u003cp\u003eK-means models utilize centroid-based clustering, and information about a model's centroids can be obtained using the \u003ccode\u003eML.CENTROIDS\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eWhile you can create and use clustering models with default settings without extensive machine learning knowledge, basic familiarity with ML and clustering models can improve results.\u003c/p\u003e\n"]]],[],null,["# Clustering overview\n===================\n\nClustering is an unsupervised machine learning technique you can use to group\nsimilar records together. It is a useful approach for when you want to\nunderstand what groups or clusters you have in your data, but don't have\nlabeled data to train a model on. For example, if you had unlabeled data about\nsubway ticket purchases, you could cluster that data by ticket purchase time to\nbetter understand what time periods have the heaviest subway usage. For more\ninformation, see\n[What is clustering?](https://developers.google.com/machine-learning/clustering/overview)\n\n[K-means models](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-kmeans)\nare widely used to perform clustering. You can use k-means models with the\n[`ML.PREDICT` function](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-predict)\nto cluster data, or with the\n[`ML.DETECT_ANOMALIES` function](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-detect-anomalies)\nto perform [anomaly detection](/bigquery/docs/anomaly-detection-overview).\n\nK-means models use\n[centroid-based clustering](https://developers.google.com/machine-learning/clustering/clustering-algorithms#centroid-based_clustering) to organize data into clusters.\nTo get information about a k-mean model's centroids, you can use the\n[`ML.CENTROIDS` function](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-centroids).\n\nRecommended knowledge\n---------------------\n\nBy using the default settings in the `CREATE MODEL` statements and the\ninference functions, you can create and use a clustering model even\nwithout much ML knowledge. However, having basic knowledge about\nML development, and clustering models in particular,\nhelps 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)\n- [Clustering](https://developers.google.com/machine-learning/clustering)"]]