Skip to content

module rkmeans


function rkmeans

1
rkmeans(image, k, nodata=-99999, **kwargs)

This function allows to classify satellite images using k-means

In principle, this function allows to classify satellite images specifying a k value (clusters), however it is recommended to find the optimal value of k using the calkmeans function embedded in this package.

Parameters:

  • image: Optical images. It must be rasterio.io.DatasetReader with 3d.

  • k: The number of clusters to be detected.

  • nodata: The NoData value to replace with -99999.

  • **kwargs: These will be passed to scikit-learn KMeans, please see full lists at:

  • https: //scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html

Return:

Labels of classification as numpy object with 2d.


This file was automatically generated via lazydocs.


Last update: 2023-08-02