earthengine-api 1.5.24__py3-none-any.whl → 1.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of earthengine-api might be problematic. Click here for more details.
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/METADATA +1 -1
- earthengine_api-1.6.0.dist-info/RECORD +107 -0
- ee/__init__.py +11 -10
- ee/_arg_types.py +2 -1
- ee/_cloud_api_utils.py +7 -6
- ee/_helpers.py +3 -2
- ee/apifunction.py +11 -9
- ee/apitestcase.py +2 -1
- ee/batch.py +46 -42
- ee/blob.py +2 -2
- ee/classifier.py +57 -59
- ee/cli/commands.py +9 -7
- ee/cli/utils.py +13 -9
- ee/clusterer.py +39 -41
- ee/collection.py +42 -42
- ee/computedobject.py +10 -10
- ee/confusionmatrix.py +8 -8
- ee/customfunction.py +2 -2
- ee/data.py +15 -14
- ee/daterange.py +9 -9
- ee/deprecation.py +13 -11
- ee/deserializer.py +5 -5
- ee/dictionary.py +11 -11
- ee/ee_array.py +17 -17
- ee/ee_date.py +22 -22
- ee/ee_list.py +15 -15
- ee/ee_number.py +5 -5
- ee/ee_string.py +6 -6
- ee/ee_types.py +2 -2
- ee/element.py +14 -14
- ee/errormargin.py +3 -3
- ee/feature.py +67 -70
- ee/featurecollection.py +30 -32
- ee/filter.py +88 -90
- ee/function.py +3 -3
- ee/geometry.py +61 -62
- ee/image.py +216 -209
- ee/image_converter.py +2 -2
- ee/imagecollection.py +23 -20
- ee/join.py +13 -15
- ee/kernel.py +55 -57
- ee/oauth.py +26 -20
- ee/pixeltype.py +5 -5
- ee/projection.py +4 -3
- ee/reducer.py +39 -41
- ee/serializer.py +4 -4
- ee/table_converter.py +3 -2
- ee/terrain.py +6 -8
- ee/tests/_cloud_api_utils_test.py +1 -1
- ee/tests/_helpers_test.py +1 -1
- ee/tests/batch_test.py +1 -1
- ee/tests/data_test.py +2 -2
- ee/tests/ee_test.py +3 -3
- ee/tests/errormargin_test.py +1 -1
- ee/tests/image_converter_test.py +2 -2
- ee/tests/pixeltype_test.py +1 -2
- ee/tests/projection_test.py +2 -3
- ee/tests/table_converter_test.py +2 -2
- earthengine_api-1.5.24.dist-info/RECORD +0 -107
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/WHEEL +0 -0
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/entry_points.txt +0 -0
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/licenses/LICENSE +0 -0
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/top_level.txt +0 -0
ee/classifier.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"""A wrapper for Classifiers."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Optional
|
|
5
|
-
|
|
6
4
|
from ee import _arg_types
|
|
7
5
|
from ee import apifunction
|
|
8
6
|
from ee import computedobject
|
|
@@ -59,34 +57,34 @@ class Classifier(computedobject.ComputedObject):
|
|
|
59
57
|
|
|
60
58
|
def amnhMaxent(
|
|
61
59
|
# pylint: disable=invalid-name
|
|
62
|
-
categoricalNames:
|
|
63
|
-
outputFormat:
|
|
64
|
-
autoFeature:
|
|
60
|
+
categoricalNames: _arg_types.List | None = None,
|
|
61
|
+
outputFormat: _arg_types.String | None = None,
|
|
62
|
+
autoFeature: _arg_types.Bool | None = None,
|
|
65
63
|
# pylint: enable=invalid-name
|
|
66
|
-
linear:
|
|
67
|
-
quadratic:
|
|
68
|
-
product:
|
|
69
|
-
threshold:
|
|
70
|
-
hinge:
|
|
64
|
+
linear: _arg_types.Bool | None = None,
|
|
65
|
+
quadratic: _arg_types.Bool | None = None,
|
|
66
|
+
product: _arg_types.Bool | None = None,
|
|
67
|
+
threshold: _arg_types.Bool | None = None,
|
|
68
|
+
hinge: _arg_types.Bool | None = None,
|
|
71
69
|
# pylint: disable=invalid-name
|
|
72
|
-
hingeThreshold:
|
|
73
|
-
l2lqThreshold:
|
|
74
|
-
lq2lqptThreshold:
|
|
75
|
-
addSamplesToBackground:
|
|
76
|
-
addAllSamplesToBackground:
|
|
77
|
-
betaMultiplier:
|
|
78
|
-
betaHinge:
|
|
79
|
-
betaLqp:
|
|
80
|
-
betaCategorical:
|
|
81
|
-
betaThreshold:
|
|
70
|
+
hingeThreshold: _arg_types.Integer | None = None,
|
|
71
|
+
l2lqThreshold: _arg_types.Integer | None = None,
|
|
72
|
+
lq2lqptThreshold: _arg_types.Integer | None = None,
|
|
73
|
+
addSamplesToBackground: _arg_types.Bool | None = None,
|
|
74
|
+
addAllSamplesToBackground: _arg_types.Bool | None = None,
|
|
75
|
+
betaMultiplier: _arg_types.Number | None = None,
|
|
76
|
+
betaHinge: _arg_types.Number | None = None,
|
|
77
|
+
betaLqp: _arg_types.Number | None = None,
|
|
78
|
+
betaCategorical: _arg_types.Number | None = None,
|
|
79
|
+
betaThreshold: _arg_types.Number | None = None,
|
|
82
80
|
# pylint: enable=invalid-name
|
|
83
|
-
extrapolate:
|
|
81
|
+
extrapolate: _arg_types.Bool | None = None,
|
|
84
82
|
# pylint: disable=invalid-name
|
|
85
|
-
doClamp:
|
|
86
|
-
writeClampGrid:
|
|
87
|
-
randomTestPoints:
|
|
83
|
+
doClamp: _arg_types.Bool | None = None,
|
|
84
|
+
writeClampGrid: _arg_types.Bool | None = None,
|
|
85
|
+
randomTestPoints: _arg_types.Integer | None = None,
|
|
88
86
|
# pylint: enable=invalid-name
|
|
89
|
-
seed:
|
|
87
|
+
seed: _arg_types.Integer | None = None,
|
|
90
88
|
) -> Classifier:
|
|
91
89
|
"""Returns a Maximum Entropy classifier.
|
|
92
90
|
|
|
@@ -229,20 +227,20 @@ class Classifier(computedobject.ComputedObject):
|
|
|
229
227
|
@staticmethod
|
|
230
228
|
def libsvm(
|
|
231
229
|
# pylint: disable=invalid-name
|
|
232
|
-
decisionProcedure:
|
|
233
|
-
svmType:
|
|
234
|
-
kernelType:
|
|
230
|
+
decisionProcedure: _arg_types.String | None = None,
|
|
231
|
+
svmType: _arg_types.String | None = None,
|
|
232
|
+
kernelType: _arg_types.String | None = None,
|
|
235
233
|
# pylint: enable=invalid-name
|
|
236
|
-
shrinking:
|
|
237
|
-
degree:
|
|
238
|
-
gamma:
|
|
239
|
-
coef0:
|
|
240
|
-
cost:
|
|
241
|
-
nu:
|
|
234
|
+
shrinking: _arg_types.Bool | None = None,
|
|
235
|
+
degree: _arg_types.Integer | None = None,
|
|
236
|
+
gamma: _arg_types.Number | None = None,
|
|
237
|
+
coef0: _arg_types.Number | None = None,
|
|
238
|
+
cost: _arg_types.Number | None = None,
|
|
239
|
+
nu: _arg_types.Number | None = None,
|
|
242
240
|
# pylint: disable=invalid-name
|
|
243
|
-
terminationEpsilon:
|
|
244
|
-
lossEpsilon:
|
|
245
|
-
oneClass:
|
|
241
|
+
terminationEpsilon: _arg_types.Number | None = None,
|
|
242
|
+
lossEpsilon: _arg_types.Number | None = None,
|
|
243
|
+
oneClass: _arg_types.Integer | None = None,
|
|
246
244
|
# pylint: enable=invalid-name
|
|
247
245
|
) -> Classifier:
|
|
248
246
|
"""Returns an empty Support Vector Machine classifier.
|
|
@@ -305,9 +303,9 @@ class Classifier(computedobject.ComputedObject):
|
|
|
305
303
|
|
|
306
304
|
@staticmethod
|
|
307
305
|
def minimumDistance(
|
|
308
|
-
metric:
|
|
306
|
+
metric: _arg_types.String | None = None,
|
|
309
307
|
# pylint: disable-next=invalid-name
|
|
310
|
-
kNearest:
|
|
308
|
+
kNearest: _arg_types.Integer | None = None,
|
|
311
309
|
) -> Classifier:
|
|
312
310
|
# pyformat: disable
|
|
313
311
|
"""Returns a minimum distance classifier for the given distance metric.
|
|
@@ -383,8 +381,8 @@ class Classifier(computedobject.ComputedObject):
|
|
|
383
381
|
@staticmethod
|
|
384
382
|
def smileCart(
|
|
385
383
|
# pylint: disable=invalid-name
|
|
386
|
-
maxNodes:
|
|
387
|
-
minLeafPopulation:
|
|
384
|
+
maxNodes: _arg_types.Integer | None = None,
|
|
385
|
+
minLeafPopulation: _arg_types.Integer | None = None,
|
|
388
386
|
# pylint: enable=invalid-name
|
|
389
387
|
) -> Classifier:
|
|
390
388
|
"""Returns an empty CART classifier.
|
|
@@ -406,13 +404,13 @@ class Classifier(computedobject.ComputedObject):
|
|
|
406
404
|
@staticmethod
|
|
407
405
|
def smileGradientTreeBoost(
|
|
408
406
|
numberOfTrees: _arg_types.Integer, # pylint: disable=invalid-name
|
|
409
|
-
shrinkage:
|
|
407
|
+
shrinkage: _arg_types.Number | None = None,
|
|
410
408
|
# pylint: disable=invalid-name
|
|
411
|
-
samplingRate:
|
|
412
|
-
maxNodes:
|
|
409
|
+
samplingRate: _arg_types.Number | None = None,
|
|
410
|
+
maxNodes: _arg_types.Integer | None = None,
|
|
413
411
|
# pylint: enable=invalid-name
|
|
414
|
-
loss:
|
|
415
|
-
seed:
|
|
412
|
+
loss: _arg_types.String | None = None,
|
|
413
|
+
seed: _arg_types.Integer | None = None,
|
|
416
414
|
) -> Classifier:
|
|
417
415
|
"""Returns an empty Gradient Tree Boost classifier.
|
|
418
416
|
|
|
@@ -440,10 +438,10 @@ class Classifier(computedobject.ComputedObject):
|
|
|
440
438
|
|
|
441
439
|
@staticmethod
|
|
442
440
|
def smileKNN(
|
|
443
|
-
k:
|
|
441
|
+
k: _arg_types.Integer | None = None,
|
|
444
442
|
# pylint: disable-next=invalid-name
|
|
445
|
-
searchMethod:
|
|
446
|
-
metric:
|
|
443
|
+
searchMethod: _arg_types.String | None = None,
|
|
444
|
+
metric: _arg_types.String | None = None,
|
|
447
445
|
) -> Classifier:
|
|
448
446
|
# pyformat: disable
|
|
449
447
|
"""Returns an empty k-NN classifier.
|
|
@@ -476,7 +474,7 @@ class Classifier(computedobject.ComputedObject):
|
|
|
476
474
|
|
|
477
475
|
@staticmethod
|
|
478
476
|
def smileNaiveBayes(
|
|
479
|
-
lambda_:
|
|
477
|
+
lambda_: _arg_types.Number | None = None, **kwargs
|
|
480
478
|
) -> Classifier:
|
|
481
479
|
# pylint: disable=g-doc-args
|
|
482
480
|
"""Returns an empty Naive Bayes classifier.
|
|
@@ -503,12 +501,12 @@ class Classifier(computedobject.ComputedObject):
|
|
|
503
501
|
def smileRandomForest(
|
|
504
502
|
# pylint: disable=invalid-name
|
|
505
503
|
numberOfTrees: _arg_types.Integer,
|
|
506
|
-
variablesPerSplit:
|
|
507
|
-
minLeafPopulation:
|
|
508
|
-
bagFraction:
|
|
509
|
-
maxNodes:
|
|
504
|
+
variablesPerSplit: _arg_types.Integer | None = None,
|
|
505
|
+
minLeafPopulation: _arg_types.Integer | None = None,
|
|
506
|
+
bagFraction: _arg_types.Number | None = None,
|
|
507
|
+
maxNodes: _arg_types.Integer | None = None,
|
|
510
508
|
# pylint: enable=invalid-name
|
|
511
|
-
seed:
|
|
509
|
+
seed: _arg_types.Integer | None = None,
|
|
512
510
|
) -> Classifier:
|
|
513
511
|
"""Returns an empty Random Forest classifier.
|
|
514
512
|
|
|
@@ -536,7 +534,7 @@ class Classifier(computedobject.ComputedObject):
|
|
|
536
534
|
|
|
537
535
|
@staticmethod
|
|
538
536
|
def spectralRegion(
|
|
539
|
-
coordinates: _arg_types.List, schema:
|
|
537
|
+
coordinates: _arg_types.List, schema: _arg_types.List | None = None
|
|
540
538
|
) -> Classifier:
|
|
541
539
|
"""Returns a spectral region classifier.
|
|
542
540
|
|
|
@@ -569,11 +567,11 @@ class Classifier(computedobject.ComputedObject):
|
|
|
569
567
|
features: _arg_types.FeatureCollection,
|
|
570
568
|
# pylint: disable=invalid-name
|
|
571
569
|
classProperty: _arg_types.String,
|
|
572
|
-
inputProperties:
|
|
570
|
+
inputProperties: _arg_types.List | None = None,
|
|
573
571
|
# pylint: enable=invalid-name
|
|
574
|
-
subsampling:
|
|
572
|
+
subsampling: _arg_types.Number | None = None,
|
|
575
573
|
# pylint: disable-next=invalid-name
|
|
576
|
-
subsamplingSeed:
|
|
574
|
+
subsamplingSeed: _arg_types.Integer | None = None,
|
|
577
575
|
) -> Classifier:
|
|
578
576
|
"""Returns a trained classifier.
|
|
579
577
|
|
ee/cli/commands.py
CHANGED
|
@@ -8,6 +8,7 @@ the actions to be taken when the command is executed.
|
|
|
8
8
|
import argparse
|
|
9
9
|
import calendar
|
|
10
10
|
import collections
|
|
11
|
+
from collections.abc import Sequence
|
|
11
12
|
import datetime
|
|
12
13
|
import json
|
|
13
14
|
import logging
|
|
@@ -16,7 +17,7 @@ import re
|
|
|
16
17
|
import shutil
|
|
17
18
|
import sys
|
|
18
19
|
import tempfile
|
|
19
|
-
from typing import Any,
|
|
20
|
+
from typing import Any, Union
|
|
20
21
|
import urllib.parse
|
|
21
22
|
|
|
22
23
|
# Prevent TensorFlow from logging anything at the native level.
|
|
@@ -1088,7 +1089,7 @@ class RmCommand:
|
|
|
1088
1089
|
return ee.data.getInfo(asset_id)
|
|
1089
1090
|
except ee.EEException as e:
|
|
1090
1091
|
if verbose:
|
|
1091
|
-
print('Failed to get info for
|
|
1092
|
+
print(f'Failed to get info for {asset_id}. {e}')
|
|
1092
1093
|
return None
|
|
1093
1094
|
|
|
1094
1095
|
def _delete_asset(self, asset_id, recursive, verbose, dry_run):
|
|
@@ -1108,7 +1109,7 @@ class RmCommand:
|
|
|
1108
1109
|
try:
|
|
1109
1110
|
ee.data.deleteAsset(asset_id)
|
|
1110
1111
|
except ee.EEException as e:
|
|
1111
|
-
print('Failed to delete
|
|
1112
|
+
print(f'Failed to delete {asset_id}. {e}')
|
|
1112
1113
|
|
|
1113
1114
|
|
|
1114
1115
|
class TaskCancelCommand:
|
|
@@ -1141,7 +1142,7 @@ class TaskCancelCommand:
|
|
|
1141
1142
|
print('Canceling task "%s"' % task_id)
|
|
1142
1143
|
ee.data.cancelTask(task_id)
|
|
1143
1144
|
elif not cancel_all:
|
|
1144
|
-
print('Task "
|
|
1145
|
+
print('Task "{}" already in state "{}".'.format(status['id'], state))
|
|
1145
1146
|
|
|
1146
1147
|
|
|
1147
1148
|
class TaskInfoCommand:
|
|
@@ -1862,8 +1863,7 @@ def _make_rpc_friendly(model_dir, tag, in_map, out_map, vars_path):
|
|
|
1862
1863
|
|
|
1863
1864
|
# Create new input placeholders to receive RPC TensorProto payloads
|
|
1864
1865
|
in_op_map = {
|
|
1865
|
-
k: tf.placeholder(
|
|
1866
|
-
tf.string, shape=[None], name='earthengine_in_{}'.format(i))
|
|
1866
|
+
k: tf.placeholder(tf.string, shape=[None], name=f'earthengine_in_{i}')
|
|
1867
1867
|
for (i, k) in enumerate(input_new_keys)
|
|
1868
1868
|
}
|
|
1869
1869
|
|
|
@@ -1888,7 +1888,9 @@ def _make_rpc_friendly(model_dir, tag, in_map, out_map, vars_path):
|
|
|
1888
1888
|
out_tensor = saved_model_utils.build_tensor_info(
|
|
1889
1889
|
_encode_op(
|
|
1890
1890
|
tf.get_default_graph().get_tensor_by_name(k),
|
|
1891
|
-
name='earthengine_out_{}'
|
|
1891
|
+
name=f'earthengine_out_{index}',
|
|
1892
|
+
)
|
|
1893
|
+
)
|
|
1892
1894
|
|
|
1893
1895
|
sig_out[_strip_index(v)] = out_tensor
|
|
1894
1896
|
|
ee/cli/utils.py
CHANGED
|
@@ -6,6 +6,7 @@ the classes for configuration and runtime context management.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import collections
|
|
9
|
+
from collections.abc import Iterable
|
|
9
10
|
import datetime
|
|
10
11
|
import json
|
|
11
12
|
import os
|
|
@@ -13,7 +14,7 @@ import re
|
|
|
13
14
|
import tempfile
|
|
14
15
|
import threading
|
|
15
16
|
import time
|
|
16
|
-
from typing import Any, AnyStr,
|
|
17
|
+
from typing import Any, AnyStr, Optional, Union
|
|
17
18
|
import urllib.parse
|
|
18
19
|
|
|
19
20
|
from google.cloud import storage
|
|
@@ -152,7 +153,7 @@ class CommandLineConfig:
|
|
|
152
153
|
def _split_gcs_path(path):
|
|
153
154
|
m = re.search('gs://([a-z0-9-_.]*)/(.*)', path, re.IGNORECASE)
|
|
154
155
|
if not m:
|
|
155
|
-
raise ValueError('
|
|
156
|
+
raise ValueError(f"'{path}' is not a valid GCS path")
|
|
156
157
|
|
|
157
158
|
return m.groups()
|
|
158
159
|
|
|
@@ -182,7 +183,7 @@ class GcsHelper:
|
|
|
182
183
|
raise ValueError('Size of files in \'{}\' exceeds allowed size: '
|
|
183
184
|
'{} > {}.'.format(path, total_bytes, max_bytes))
|
|
184
185
|
if total_bytes == 0:
|
|
185
|
-
raise ValueError(
|
|
186
|
+
raise ValueError(f"No files found at '{path}'.")
|
|
186
187
|
|
|
187
188
|
def download_dir_to_temp(self, path: str) -> str:
|
|
188
189
|
"""Downloads recursively the contents at a GCS path to a temp directory."""
|
|
@@ -252,7 +253,7 @@ def wait_for_task(
|
|
|
252
253
|
) -> None:
|
|
253
254
|
"""Waits for the specified task to finish, or a timeout to occur."""
|
|
254
255
|
start = time.time()
|
|
255
|
-
elapsed
|
|
256
|
+
elapsed: float
|
|
256
257
|
last_check = 0
|
|
257
258
|
while True:
|
|
258
259
|
elapsed = time.time() - start
|
|
@@ -274,7 +275,9 @@ def wait_for_task(
|
|
|
274
275
|
time.sleep(min(10, remaining))
|
|
275
276
|
else:
|
|
276
277
|
break
|
|
277
|
-
print(
|
|
278
|
+
print(
|
|
279
|
+
f'Wait for task {task_id} timed out after {elapsed:.2f} seconds'
|
|
280
|
+
)
|
|
278
281
|
|
|
279
282
|
|
|
280
283
|
def wait_for_tasks(
|
|
@@ -385,9 +388,10 @@ def _gcs_ls(bucket: str, prefix: str = '') -> Iterable[str]:
|
|
|
385
388
|
raise ee.ee_exception.EEException('Unexpected HTTP error: %s' % str(e))
|
|
386
389
|
|
|
387
390
|
if response.status < 100 or response.status >= 300:
|
|
388
|
-
raise ee.ee_exception.EEException(
|
|
389
|
-
|
|
390
|
-
|
|
391
|
+
raise ee.ee_exception.EEException(
|
|
392
|
+
'Error retrieving bucket %s; Server returned HTTP code: %d'
|
|
393
|
+
% (bucket, response.status)
|
|
394
|
+
)
|
|
391
395
|
|
|
392
396
|
json_content = json.loads(content)
|
|
393
397
|
if 'error' in json_content:
|
|
@@ -402,7 +406,7 @@ def _gcs_ls(bucket: str, prefix: str = '') -> Iterable[str]:
|
|
|
402
406
|
object_names = [str(gc_object['name']) for gc_object in objects]
|
|
403
407
|
|
|
404
408
|
for name in object_names:
|
|
405
|
-
yield 'gs
|
|
409
|
+
yield f'gs://{bucket}/{name}'
|
|
406
410
|
|
|
407
411
|
# GCS indicates no more results
|
|
408
412
|
if 'nextPageToken' not in json_content:
|
ee/clusterer.py
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"""A wrapper for Clusterers."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Optional
|
|
5
|
-
|
|
6
4
|
from ee import _arg_types
|
|
7
5
|
from ee import apifunction
|
|
8
6
|
from ee import computedobject
|
|
@@ -72,7 +70,7 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
72
70
|
|
|
73
71
|
# TODO: The Optional is suspect. The return from schema is
|
|
74
72
|
# never None, but the .getInfo() of the result can be None.
|
|
75
|
-
def schema(self) ->
|
|
73
|
+
def schema(self) -> ee_list.List | None:
|
|
76
74
|
"""Returns the names of the inputs used by this Clusterer.
|
|
77
75
|
|
|
78
76
|
Or None if this Clusterer has not had any training data added yet.
|
|
@@ -84,10 +82,10 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
84
82
|
self,
|
|
85
83
|
features: _arg_types.FeatureCollection,
|
|
86
84
|
# pylint: disable-next=invalid-name
|
|
87
|
-
inputProperties:
|
|
88
|
-
subsampling:
|
|
85
|
+
inputProperties: _arg_types.List | None = None,
|
|
86
|
+
subsampling: _arg_types.Number | None = None,
|
|
89
87
|
# pylint: disable-next=invalid-name
|
|
90
|
-
subsamplingSeed:
|
|
88
|
+
subsamplingSeed: _arg_types.Integer | None = None,
|
|
91
89
|
) -> Clusterer:
|
|
92
90
|
"""Returns a trained Clusterer.
|
|
93
91
|
|
|
@@ -117,15 +115,15 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
117
115
|
@staticmethod
|
|
118
116
|
def wekaCascadeKMeans(
|
|
119
117
|
# pylint: disable=invalid-name
|
|
120
|
-
minClusters:
|
|
121
|
-
maxClusters:
|
|
118
|
+
minClusters: _arg_types.Integer | None = None,
|
|
119
|
+
maxClusters: _arg_types.Integer | None = None,
|
|
122
120
|
# pylint: disable-next=invalid-name
|
|
123
|
-
restarts:
|
|
124
|
-
manual:
|
|
125
|
-
init:
|
|
121
|
+
restarts: _arg_types.Integer | None = None,
|
|
122
|
+
manual: _arg_types.Bool | None = None,
|
|
123
|
+
init: _arg_types.Bool | None = None,
|
|
126
124
|
# pylint: disable=invalid-name
|
|
127
|
-
distanceFunction:
|
|
128
|
-
maxIterations:
|
|
125
|
+
distanceFunction: _arg_types.String | None = None,
|
|
126
|
+
maxIterations: _arg_types.Integer | None = None,
|
|
129
127
|
# pylint: disable-next=invalid-name
|
|
130
128
|
) -> Clusterer:
|
|
131
129
|
"""Returns a weka Cascade K-Means Clusterer.
|
|
@@ -161,9 +159,9 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
161
159
|
|
|
162
160
|
@staticmethod
|
|
163
161
|
def wekaCobweb(
|
|
164
|
-
acuity:
|
|
165
|
-
cutoff:
|
|
166
|
-
seed:
|
|
162
|
+
acuity: _arg_types.Number | None = None,
|
|
163
|
+
cutoff: _arg_types.Number | None = None,
|
|
164
|
+
seed: _arg_types.Integer | None = None,
|
|
167
165
|
) -> Clusterer:
|
|
168
166
|
"""Returns a weka Cobweb Clusterer.
|
|
169
167
|
|
|
@@ -186,22 +184,22 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
186
184
|
@staticmethod
|
|
187
185
|
def wekaKMeans(
|
|
188
186
|
nClusters: _arg_types.Integer, # pylint: disable=invalid-name
|
|
189
|
-
init:
|
|
190
|
-
canopies:
|
|
187
|
+
init: _arg_types.Integer | None = None,
|
|
188
|
+
canopies: _arg_types.Bool | None = None,
|
|
191
189
|
# pylint: disable=invalid-name
|
|
192
|
-
maxCandidates:
|
|
193
|
-
periodicPruning:
|
|
194
|
-
minDensity:
|
|
190
|
+
maxCandidates: _arg_types.Integer | None = None,
|
|
191
|
+
periodicPruning: _arg_types.Integer | None = None,
|
|
192
|
+
minDensity: _arg_types.Integer | None = None,
|
|
195
193
|
# pylint: enable=invalid-name
|
|
196
|
-
t1:
|
|
197
|
-
t2:
|
|
194
|
+
t1: _arg_types.Number | None = None,
|
|
195
|
+
t2: _arg_types.Number | None = None,
|
|
198
196
|
# pylint: disable=invalid-name
|
|
199
|
-
distanceFunction:
|
|
200
|
-
maxIterations:
|
|
201
|
-
preserveOrder:
|
|
197
|
+
distanceFunction: _arg_types.String | None = None,
|
|
198
|
+
maxIterations: _arg_types.Integer | None = None,
|
|
199
|
+
preserveOrder: _arg_types.Bool | None = None,
|
|
202
200
|
# pylint: enable=invalid-name
|
|
203
|
-
fast:
|
|
204
|
-
seed:
|
|
201
|
+
fast: _arg_types.Bool | None = None,
|
|
202
|
+
seed: _arg_types.Integer | None = None,
|
|
205
203
|
) -> Clusterer:
|
|
206
204
|
"""Returns a weka K-Means Clusterer.
|
|
207
205
|
|
|
@@ -260,12 +258,12 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
260
258
|
@staticmethod
|
|
261
259
|
def wekaLVQ(
|
|
262
260
|
# pylint: disable=invalid-name
|
|
263
|
-
numClusters:
|
|
264
|
-
learningRate:
|
|
261
|
+
numClusters: _arg_types.Integer | None = None,
|
|
262
|
+
learningRate: _arg_types.Number | None = None,
|
|
265
263
|
# pylint: enable=invalid-name
|
|
266
|
-
epochs:
|
|
264
|
+
epochs: _arg_types.Integer | None = None,
|
|
267
265
|
# pylint: disable-next=invalid-name
|
|
268
|
-
normalizeInput:
|
|
266
|
+
normalizeInput: _arg_types.Bool | None = None,
|
|
269
267
|
) -> Clusterer:
|
|
270
268
|
"""Returns a weka Learning Vector Quantization (LVQ) Clusterer.
|
|
271
269
|
|
|
@@ -290,16 +288,16 @@ class Clusterer(computedobject.ComputedObject):
|
|
|
290
288
|
@staticmethod
|
|
291
289
|
def wekaXMeans(
|
|
292
290
|
# pylint: disable=invalid-name
|
|
293
|
-
minClusters:
|
|
294
|
-
maxClusters:
|
|
295
|
-
maxIterations:
|
|
296
|
-
maxKMeans:
|
|
297
|
-
maxForChildren:
|
|
298
|
-
useKD:
|
|
299
|
-
cutoffFactor:
|
|
300
|
-
distanceFunction:
|
|
291
|
+
minClusters: _arg_types.Integer | None = None,
|
|
292
|
+
maxClusters: _arg_types.Integer | None = None,
|
|
293
|
+
maxIterations: _arg_types.Integer | None = None,
|
|
294
|
+
maxKMeans: _arg_types.Integer | None = None,
|
|
295
|
+
maxForChildren: _arg_types.Integer | None = None,
|
|
296
|
+
useKD: _arg_types.Bool | None = None,
|
|
297
|
+
cutoffFactor: _arg_types.Number | None = None,
|
|
298
|
+
distanceFunction: _arg_types.String | None = None,
|
|
301
299
|
# pylint: enable=invalid-name
|
|
302
|
-
seed:
|
|
300
|
+
seed: _arg_types.Integer | None = None,
|
|
303
301
|
) -> Clusterer:
|
|
304
302
|
"""Returns a weka X-Means Clusterer.
|
|
305
303
|
|