很多时候我们需要监测每年或者几期影像间的地类变化,我们应该如何统计呢?这里很简单,我们首先选取我们需要区分的两期的影像,然后使用随机森林分类器进行分类,分类后将影像原始的名称重命名,也就是要去掉原始为0的地类,让其变成1,这样方便继续进行后续的地类区分。最后我们对比两期影像用Or语句寻找出需要由水体转化为其它地类的点。
函数:
ee.Classifier.smileRandomForest(numberOfTrees, variablesPerSplit, minLeafPopulation, bagFraction, maxNodes, seed)
Creates an empty Random Forest classifier.
Arguments:
numberOfTrees (Integer):
The number of decision trees to create.
variablesPerSplit (Integer, default: null):
The number of variables per split. If unspecified, uses the square root of the number of variables.
minLeafPopulation (Integer, default: 1):
Only create nodes whose training set contains at least this many points.
bagFraction (Float, default: 0.5):
The fraction of input to bag per tree.