ee.Clusterer.wekaKMeans
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
خوشه بندی داده ها با استفاده از الگوریتم k-means. می توانید از فاصله اقلیدسی (پیش فرض) یا فاصله منهتن استفاده کنید. اگر از فاصله منهتن استفاده شود، مرکزها بهعنوان میانه مؤلفهها به جای میانگین محاسبه میشوند. برای اطلاعات بیشتر رجوع کنید به:
D. Arthur, S. Vassilvitskii: 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 | بولی، پیش فرض: نادرست | از سایبان ها برای کاهش تعداد محاسبات فاصله استفاده کنید. |
maxCandidates | عدد صحیح، پیش فرض: 100 | حداکثر تعداد سایبان های کاندید برای حفظ در حافظه در هر زمان هنگام استفاده از خوشه بندی سایبان. فاصله T2 به علاوه، ویژگی های داده، تعیین می کند که چه تعداد سایبان نامزد قبل از انجام هرس دوره ای و نهایی تشکیل می شود، که ممکن است منجر به مصرف بیش از حد حافظه شود. این تنظیم از مصرف حافظه توسط تعداد زیادی سایبان نامزد جلوگیری می کند. |
periodicPruning | عدد صحیح، پیش فرض: 10000 | هر چند وقت یکبار سایبان های با چگالی کم را هنگام استفاده از خوشه بندی سایبان هرس کنیم. |
minDensity | عدد صحیح، پیش فرض: 2 | حداقل تراکم تاج پوشش، هنگام استفاده از خوشه بندی تاج، که در زیر آن یک سایبان در طول هرس دوره ای هرس می شود. |
t1 | شناور، پیش فرض: -1.5 | فاصله T1 برای استفاده هنگام استفاده از خوشه بندی سایبان. مقدار < 0 به عنوان ضریب مثبت برای T2 در نظر گرفته می شود. |
t2 | شناور، پیش فرض: -1 | فاصله T2 برای استفاده هنگام استفاده از خوشه بندی سایبان. مقادیر < 0 باعث ایجاد یک اکتشافی بر اساس ویژگی std می شود. انحراف مورد استفاده |
distanceFunction | رشته، پیشفرض: «اقلیدسی» | تابع فاصله برای استفاده گزینه ها عبارتند از: اقلیدسی و منهتن. |
maxIterations | عدد صحیح، پیش فرض: null | حداکثر تعداد تکرار |
preserveOrder | بولی، پیش فرض: نادرست | حفظ ترتیب نمونه ها |
fast | بولی، پیش فرض: نادرست | محاسبات مسافت سریعتر را با استفاده از مقادیر برش فعال می کند. محاسبه/خروجی مربعات خطاها/فاصله ها را غیرفعال می کند. |
seed | عدد صحیح، پیش فرض: 10 | دانه تصادفی. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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. |"]]