This task executes an unsupervised Mini Batch K-Means algorithm against the provided input training rasters. The algorithm iterates between two major steps, first step, samples are drawn randomly from the dataset, to form a mini-batch. These are then assigned to the nearest centroid. In the second step, the centroids are updated.
For background on the algorithm used, see Mini Batch K-Means Classification.
Example
e = ENVI()
RasterFile = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(RasterFile)
StatsTask = ENVITask('NormalizationStatistics')
StatsTask.INPUT_RASTERS = Raster
StatsTask.Execute
TrainTask = ENVITask('TrainMiniBatchKMeans')
TrainTask.INPUT_RASTER = Raster
TrainTask.Number_of_Classes = 3
TrainTask.Normalize_Min_Max = StatsTask.Normalization
TrainTask.Execute
outputModel = TrainTask.OUTPUT_MODEL
Print, outputModel.Attributes
Syntax
Result = ENVITask('TrainExtraTrees')
Input parameters (Set, Get): BRANCHING_FACTOR, INPUT_RASTERS, MODEL_DESCRIPTION, MODEL_NAME, MODEL_VERSION, NORMALIZE_MIN_MAX, NUMBER_OF_CLASSES, OUTPUT_MODEL_URI, THRESHOLD
Output parameters (Get only): OUTPUT_MODEL
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
BRANCHING_FACTOR (optional)
Specify the maximum number of clustering feature subclusters in each node. The default is 50.
INPUT_RASTERS (required)
Specify one or more preprocessed training rasters to be used for training.
MODEL_DESCRIPTION (optional)
Specify the purpose of the model.
MODEL_NAME (optional)
Specify the name of the model. The default is Mini Batch K-Means Unsupervised Classifier.
MODEL_VERSION (optional)
Specify a semantic version format (MAJOR.MINOR.PATCH) for the trained model (for example, 1.0.0). The version may indicate the following:
- MAJOR: Breaking changes to the model
- MINOR: Compatibility or new features
- PATCH: Minor adjustments
NORMALIZE_MIN_MAX (required)
Specify the data value that corresponds to 0% and 100% reflectance.
NUMBER_OF_CLASSES (optional)
Number of clusters after the final clustering step, which treats the subclusters from the leaves as new samples. Specifies the number of classes to identify. The default is 3.
OUTPUT_MODEL_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_MODEL. If you do not specify this parameter, or set it to an exclamation symbol (!), a temporary file will be created.
THRESHOLD (optional)
Specify the radius of the subcluster obtained by merging a new sample and the closest subcluster should be less than the threshold. The default is 0.5.
Output Parameters
OUTPUT_MODEL
This is a reference to the output model file.
Methods
Execute
Parameter
ParameterNames
See ENVI Help for details on these ENVITask methods.
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
See the ENVITask topic in ENVI Help for details.
Version History
Machine Learning 2.0
|
Introduced |
Machine Learning 6.2
|
Added the MODEL_VERSION and OUTPUT_MODEL_URI parameters
|
See Also
ENVI Machine Learning Algorithms Background, TrainBirch Task, TrainExtraTrees Task, TrainIsolationForest Task, TrainKNeighbors Task, TrainLinearSVM Task, TrainLocalOutlierFactor Task, TrainNaiveBayes Task, TrainRandomForest Task, TrainRBFSVM Task