ee.FeatureCollection.randomColumn

একটি সংগ্রহে নির্ধারক সিউডোর্যান্ডম সংখ্যার একটি কলাম যোগ করে। আউটপুট হল ডবল-নির্ভুল ফ্লোটিং পয়েন্ট সংখ্যা। 'ইউনিফর্ম' ডিস্ট্রিবিউশন ব্যবহার করার সময় (ডিফল্ট), আউটপুটগুলি [0, 1) এর পরিসরে থাকে। 'স্বাভাবিক' ডিস্ট্রিবিউশন ব্যবহার করে, আউটপুটগুলিতে μ=0, σ=1 আছে, কিন্তু কোনো সুস্পষ্ট সীমা নেই।

ব্যবহার রিটার্নস
FeatureCollection. randomColumn ( columnName , seed , distribution , rowKeys ) ফিচার কালেকশন
যুক্তি টাইপ বিস্তারিত
এই: collection ফিচার কালেকশন ইনপুট সংগ্রহ যেখানে একটি এলোমেলো কলাম যোগ করতে হবে।
columnName স্ট্রিং, ডিফল্ট: "এলোমেলো" কলামের নাম যোগ করতে হবে।
seed দীর্ঘ, ডিফল্ট: 0 এলোমেলো সংখ্যা তৈরি করার সময় ব্যবহৃত একটি বীজ।
distribution স্ট্রিং, ডিফল্ট: "ইউনিফর্ম" উৎপন্ন করার জন্য এলোমেলো সংখ্যার বিতরণের ধরন; 'ইউনিফর্ম' বা 'স্বাভাবিক'-এর একটি।
rowKeys তালিকা, ঐচ্ছিক বৈশিষ্ট্যের একটি তালিকা যা স্বতন্ত্রভাবে এবং পুনরাবৃত্তভাবে সংগ্রহের একটি উপাদান সনাক্ত করতে হবে, র্যান্ডম সংখ্যা তৈরি করতে ব্যবহৃত হয়। [system:index]-এ ডিফল্ট।

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
            .filter('country_lg == "Belgium"');
print('N features in collection', fc.size());

// Add a uniform distribution random value column to the FeatureCollection.
fc = fc.randomColumn();

// Randomly split the collection into two sets, 30% and 70% of the total.
var randomSample30 = fc.filter('random < 0.3');
print('N features in 30% sample', randomSample30.size());

var randomSample70 = fc.filter('random >= 0.3');
print('N features in 70% sample', randomSample70.size());

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')
print('N features in collection:', fc.size().getInfo())

# Add a uniform distribution random value column to the FeatureCollection.
fc = fc.randomColumn()

# Randomly split the collection into two sets, 30% and 70% of the total.
random_sample_30 = fc.filter('random < 0.3')
print('N features in 30% sample:', random_sample_30.size().getInfo())

random_sample_70 = fc.filter('random >= 0.3')
print('N features in 70% sample:', random_sample_70.size().getInfo())