Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить некоммерческое право на сохранение доступа к Earth Engine.
ee.Clusterer.wekaKMeans
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Кластеризация данных с помощью алгоритма k-средних. Можно использовать как евклидово расстояние (по умолчанию), так и манхэттенское расстояние. При использовании манхэттенского расстояния центроиды вычисляются как покомпонентная медиана, а не как среднее значение. Подробнее см.:
Д. Артур, С. Васильвицкий: k-means++: преимущества тщательного посева. В: Труды восемнадцатого ежегодного симпозиума ACM-SIAM по дискретным алгоритмам, 1027–1035, 2007.
Использование | Возврат | ee.Clusterer.wekaKMeans(nClusters, init , canopies , maxCandidates , periodicPruning , minDensity , t1 , t2 , distanceFunction , maxIterations , preserveOrder , fast , seed ) | Кластеризатор |
Аргумент | Тип | Подробности | nClusters | Целое число | Количество кластеров. |
init | Целое число, по умолчанию: 0 | Метод инициализации, который следует использовать. 0 = случайный, 1 = k-means++, 2 = полог, 3 = самый дальний первый. |
canopies | Логическое значение, по умолчанию: false | Используйте навесы, чтобы сократить количество расчетов расстояний. |
maxCandidates | Целое число, по умолчанию: 100 | Максимальное количество потенциальных пологов, сохраняемых в памяти одновременно при кластеризации пологов. Расстояние T2 плюс характеристики данных определяют количество потенциальных пологов, сформированных до выполнения периодической и окончательной обрезки, что может привести к чрезмерному потреблению памяти. Этот параметр позволяет избежать потребления памяти большим количеством потенциальных пологов. |
periodicPruning | Целое число, по умолчанию: 10000 | Как часто следует обрезать низкоплотные пологи при группировании полога. |
minDensity | Целое число, по умолчанию: 2 | Минимальная плотность полога при группировании полога, ниже которой полог будет обрезаться во время периодической обрезки. |
t1 | Плавающий, по умолчанию: -1,5 | Расстояние T1, используемое при кластеризации полога. Значение < 0 принимается как положительный множитель для T2. |
t2 | Плавающее число, по умолчанию: -1 | Расстояние T2, используемое при кластеризации полога. Значения < 0 приводят к использованию эвристики, основанной на стандартном отклонении атрибута. |
distanceFunction | Строка, по умолчанию: «Евклидова» | Используемая функция расстояния. Возможные варианты: евклидово и манхэттенское. |
maxIterations | Целое число, по умолчанию: null | Максимальное количество итераций. |
preserveOrder | Логическое значение, по умолчанию: false | Сохраняйте порядок экземпляров. |
fast | Логическое значение, по умолчанию: false | Позволяет ускорить расчёт расстояний, используя пороговые значения. Отключает расчёт/вывод квадратов ошибок/расстояний. |
seed | Целое число, по умолчанию: 10 | Рандомизирующее семя. |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\u003cp\u003eClusters data using the k-means algorithm with either Euclidean (default) or Manhattan distance.\u003c/p\u003e\n"],["\u003cp\u003eIf Manhattan distance is selected, centroids are calculated using the component-wise median instead of the mean.\u003c/p\u003e\n"],["\u003cp\u003eOffers various initialization methods including random, k-means++, canopy, and farthest first.\u003c/p\u003e\n"],["\u003cp\u003eAllows customization of distance calculation, iteration limits, and performance optimization through parameters.\u003c/p\u003e\n"]]],["The k-means algorithm clusters data using either Euclidean or Manhattan distance. Manhattan distance uses component-wise median for centroids, while Euclidean uses the mean. Initialization methods include random, k-means++, canopy, and farthest first. Canopies can be used to optimize distance calculations. Parameters control the number of clusters, pruning frequency, density thresholds, and distance settings. Additional options include limiting iterations, preserving data order, and using a fast distance calculation mode.\n"],null,["# ee.Clusterer.wekaKMeans\n\nCluster data using the k-means algorithm. Can use either the Euclidean distance (default) or the Manhattan distance. If the Manhattan distance is used, then centroids are computed as the component-wise median rather than mean. For more information see:\n\n\u003cbr /\u003e\n\nD. Arthur, S. Vassilvitskii: k-means++: the advantages of careful seeding. In: Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, 1027-1035, 2007.\n\n| Usage | Returns |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|\n| `ee.Clusterer.wekaKMeans(nClusters, `*init* `, `*canopies* `, `*maxCandidates* `, `*periodicPruning* `, `*minDensity* `, `*t1* `, `*t2* `, `*distanceFunction* `, `*maxIterations* `, `*preserveOrder* `, `*fast* `, `*seed*`)` | Clusterer |\n\n| Argument | Type | Details |\n|--------------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `nClusters` | Integer | Number of clusters. |\n| `init` | Integer, default: 0 | Initialization method to use. 0 = random, 1 = k-means++, 2 = canopy, 3 = farthest first. |\n| `canopies` | Boolean, default: false | Use canopies to reduce the number of distance calculations. |\n| `maxCandidates` | Integer, default: 100 | Maximum number of candidate canopies to retain in memory at any one time when using canopy clustering. T2 distance plus, data characteristics, will determine how many candidate canopies are formed before periodic and final pruning are performed, which might result in exceess memory consumption. This setting avoids large numbers of candidate canopies consuming memory. |\n| `periodicPruning` | Integer, default: 10000 | How often to prune low density canopies when using canopy clustering. |\n| `minDensity` | Integer, default: 2 | Minimum canopy density, when using canopy clustering, below which a canopy will be pruned during periodic pruning. |\n| `t1` | Float, default: -1.5 | The T1 distance to use when using canopy clustering. A value \\\u003c 0 is taken as a positive multiplier for T2. |\n| `t2` | Float, default: -1 | The T2 distance to use when using canopy clustering. Values \\\u003c 0 cause a heuristic based on attribute std. deviation to be used. |\n| `distanceFunction` | String, default: \"Euclidean\" | Distance function to use. Options are: Euclidean and Manhattan. |\n| `maxIterations` | Integer, default: null | Maximum number of iterations. |\n| `preserveOrder` | Boolean, default: false | Preserve order of instances. |\n| `fast` | Boolean, default: false | Enables faster distance calculations, using cut-off values. Disables the calculation/output of squared errors/distances. |\n| `seed` | Integer, default: 10 | The randomization seed. |"]]