ee.Classifier.amnhMaxent

최대 엔트로피 분류기를 만듭니다. Maxent는 알려진 존재 위치와 다수의 '배경' 위치의 환경 데이터를 사용하여 종 분포 확률을 모델링하는 데 사용됩니다. 자세한 내용과 인용은 https://biodiversityinformatics.amnh.org/open_source/maxent/ 및 참고 문헌인 Phillips et al., 2004 A maximum entropy approach to species distribution modeling, Proceedings of the Twenty-First International Conference on Machine Learning. 출력은 모델링된 확률이 포함된 '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불리언, 기본값: true2차 기능을 사용할 수 있도록 허용합니다. autofeature가 true이면 무시됩니다.
product불리언, 기본값: true제품 기능 사용을 허용합니다. autofeature가 true이면 무시됩니다.
threshold불리언, 기본값: false기준점 기능을 사용할 수 있도록 허용합니다. autofeature가 true이면 무시됩니다.
hinge불리언, 기본값: true힌지 기능 사용을 허용합니다. autofeature가 true이면 무시됩니다.
hingeThreshold정수, 기본값: 15힌지 기능이 사용되기 시작하는 샘플 수입니다. autofeature가 false인 경우 무시됩니다.
l2lqThreshold정수, 기본값: 10이차 특징이 사용되기 시작하는 샘플 수입니다. 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클램핑의 공간 분포를 보여주는 밴드를 출력에 추가합니다 ('clamp'). 각 지점에서 값은 클램핑이 적용된 예측 값과 클램핑이 적용되지 않은 예측 값 간의 절대 차이입니다.
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)