ee.Classifier.amnhMaxent

最大エントロピー分類器を作成します。Maxent は、既知の生息地の環境データと、多数の「バックグラウンド」の生息地の環境データを使用して、種の分布確率をモデル化するために使用されます。詳細と引用については、https://biodiversityinformatics.amnh.org/open_source/maxent/ をご覧ください。また、参考文献として Phillips らの論文(2004 年、種分布モデリングに対する最大エントロピー アプローチ、第 21 回国際機械学習会議の議事録。出力は、モデル化された確率を含む「probability」という名前の単一のバンドです。また、「writeClampGrid」引数が true の場合は、「clamp」という名前の追加のバンドも含まれます。

用途戻り値
ee.Classifier.amnhMaxent(categoricalNames, outputFormat, autoFeature, linear, quadratic, product, threshold, hinge, hingeThreshold, l2lqThreshold, lq2lqptThreshold, addSamplesToBackground, addAllSamplesToBackground, betaMultiplier, betaHinge, betaLqp, betaCategorical, betaThreshold, extrapolate, doClamp, writeClampGrid, randomTestPoints, seed)分類器
引数タイプ詳細
categoricalNamesリスト、デフォルト: nullカテゴリ入力の名前のリスト。この引数にリストされていない入力は、連続していると見なされます。
outputFormat文字列、デフォルト: "cloglog"出力の確率の表現。
autoFeatureブール値。デフォルト値は true です。トレーニング サンプル数に基づいて、使用する特徴クラスを自動的に選択します。
linearブール値。デフォルト値は true です。線形フィーチャーの使用を許可します。autofeature が true の場合は無視されます。
quadraticブール値。デフォルト値は true です。二次特徴の使用を許可します。autofeature が true の場合は無視されます。
productブール値。デフォルト値は true です。プロダクト機能の使用を許可します。autofeature が true の場合は無視されます。
thresholdブール値。デフォルト値は false です。しきい値機能の使用を許可します。autofeature が true の場合は無視されます。
hingeブール値。デフォルト値は true です。ヒンジ機能の使用を許可します。autofeature が true の場合は無視されます。
hingeThreshold整数、デフォルト: 15ヒンジ特徴の使用が開始されるサンプル数。autofeature が false の場合は無視されます。
l2lqThreshold整数、デフォルト: 102 次特徴の使用が開始されるサンプル数。autofeature が false の場合は無視されます。
lq2lqptThreshold整数。デフォルト値は 80 です。プロダクトとしきい値の特徴が使用され始めるサンプル数。autofeature が false の場合は無視されます。
addSamplesToBackgroundブール値。デフォルト値は true です。バックグラウンドにまだ存在しない環境値の組み合わせを持つサンプルをバックグラウンドに追加します。
addAllSamplesToBackgroundブール値。デフォルト値は false です。環境値の組み合わせがバックグラウンドにすでに存在する場合でも、すべてのサンプルをバックグラウンドに追加します。
betaMultiplier浮動小数点数、デフォルト: 1正則化乗数。すべての自動正則化パラメータにこの数値を掛けます。数値が大きいほど、分布が広くなります。
betaHinge浮動小数点数、デフォルト: -1すべてのヒンジ特徴に適用される正則化パラメータ。負の値を指定すると、自動設定が有効になります。
betaLqp浮動小数点数、デフォルト: -1すべての線形、二次、積の特徴に適用される正則化パラメータ。負の値にすると、自動設定が有効になります。
betaCategorical浮動小数点数、デフォルト: -1すべてのカテゴリ特徴に適用する正則化パラメータ。負の値にすると、自動設定が有効になります。
betaThreshold浮動小数点数、デフォルト: -1すべてのしきい値特徴に適用される正則化パラメータ。負の値にすると、自動設定が有効になります。
extrapolateブール値。デフォルト値は true です。推定します。トレーニング中に検出された制限外の環境空間の領域を予測します。
doClampブール値。デフォルト値は true です。出力にクランプを適用します。
writeClampGridブール値。デフォルト値は true です。クランプの空間分布を示すバンドを出力に追加します(「クランプ」)。各ポイントの値は、クランプありとクランプなしの予測値の絶対差です。
randomTestPoints整数、デフォルト: 0ランダム テストの割合。テストポイントとして保持するトレーニング ポイントの割合。AUX、省略などを計算するために使用されます。
seedLong、デフォルト: 0乱数を生成するときに使用されるシード。

コードエディタ(JavaScript)

// Create some sample species presence/absence training data.
var trainingData = ee.FeatureCollection([
  // Species present points.
  ee.Feature(ee.Geometry.Point([-122.39567, 38.02740]), {presence: 1}),
  ee.Feature(ee.Geometry.Point([-122.68560, 37.83690]), {presence: 1}),
  // Species absent points.
  ee.Feature(ee.Geometry.Point([-122.59755, 37.92402]), {presence: 0}),
  ee.Feature(ee.Geometry.Point([-122.47137, 37.99291]), {presence: 0}),
  ee.Feature(ee.Geometry.Point([-122.52905, 37.85642]), {presence: 0}),
  ee.Feature(ee.Geometry.Point([-122.03010, 37.66660]), {presence: 0})
]);

// Import a Landsat 8 surface reflectance image.
var image = ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20200606')
                // Select the optical and thermal bands.
                .select(['.._B.*']);

// Sample the image at the location of the points.
var training = image.sampleRegions({collection: trainingData, scale: 30});

// Define and train a Maxent classifier from the image-sampled points.
var classifier = ee.Classifier.amnhMaxent().train({
  features: training,
  classProperty: 'presence',
  inputProperties: image.bandNames()
});

// Classify the image using the Maxent classifier.
var imageClassified = image.classify(classifier);

// Display the layers on the map.
// Species presence probability [0, 1] grades from black to white.
Map.centerObject(image, 9);
Map.addLayer(
    image.select(['SR_B4', 'SR_B3', 'SR_B2']).multiply(0.0000275).add(-0.2),
    {min: 0, max: 0.3}, 'Image');
Map.addLayer(
    imageClassified, {bands: 'probability', min: 0, max: 1}, 'Probability');
Map.addLayer(
    trainingData.filter('presence == 0'), {color: 'red'},
    'Training data (species absent)');
Map.addLayer(
    trainingData.filter('presence == 1'), {color: 'blue'},
    'Training data (species present)');

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

import ee
import geemap.core as geemap

Colab(Python)

"""Demonstrates the ee.Classifier.amnhMaxent method."""

import ee


# Authenticates to the Earth Engine servers.
ee.Authenticate()
# Initializes the client library.
ee.Initialize()


# Create some sample species presence/absence training data.
training_data = ee.FeatureCollection([
    # Species present points.
    ee.Feature(ee.Geometry.Point([-122.39567, 38.02740]), {'presence': 1}),
    ee.Feature(ee.Geometry.Point([-122.68560, 37.83690]), {'presence': 1}),
    # Species absent points.
    ee.Feature(ee.Geometry.Point([-122.59755, 37.92402]), {'presence': 0}),
    ee.Feature(ee.Geometry.Point([-122.47137, 37.99291]), {'presence': 0}),
    ee.Feature(ee.Geometry.Point([-122.52905, 37.85642]), {'presence': 0}),
    ee.Feature(ee.Geometry.Point([-122.03010, 37.66660]), {'presence': 0})
])

# Import a Landsat 8 image and select the reflectance bands.
image = (ee.Image('LANDSAT/LC08/C02/T1_L2/LC08_044034_20200606')
         .select(['SR_B[1-7]'])
         .multiply(0.0000275).add(-0.2))  # Apply scaling factors.

# Sample the image at the location of the points.
training = image.sampleRegions(**{
    'collection': training_data,
    'scale': 30
})

# Define and train a Maxent classifier from the image-sampled points.
classifier = ee.Classifier.amnhMaxent().train(**{
    'features': training,
    'classProperty': 'presence',
    'inputProperties': image.bandNames()
})

# Classify the image using the Maxent classifier.
image_classified = image.classify(classifier)