ঘোষণা : 15 এপ্রিল, 2025 এর আগে আর্থ ইঞ্জিন ব্যবহার করার জন্য নিবন্ধিত সমস্ত অবাণিজ্যিক প্রকল্পগুলিকে অবশ্যই আর্থ ইঞ্জিন অ্যাক্সেস বজায় রাখার জন্য অ-বাণিজ্যিক যোগ্যতা যাচাই করতে হবে।
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
রিডুসার হল আর্থ ইঞ্জিনে সময়, স্থান, ব্যান্ড, অ্যারে এবং অন্যান্য ডেটা স্ট্রাকচারের সাথে ডেটা একত্রিত করার উপায়। ee.Reducer ক্লাস নির্দিষ্ট করে কিভাবে ডেটা একত্রিত করা হয়। এই শ্রেণীর হ্রাসকারীরা একত্রিতকরণের জন্য ব্যবহার করার জন্য একটি সাধারণ পরিসংখ্যান নির্দিষ্ট করতে পারে (যেমন সর্বনিম্ন, সর্বোচ্চ, গড়, মধ্যক, মানক বিচ্যুতি ইত্যাদি), বা ইনপুট ডেটার আরও জটিল সারাংশ (যেমন হিস্টোগ্রাম, লিনিয়ার রিগ্রেশন, তালিকা)। সময়ের সাথে হ্রাস ঘটতে পারে ( imageCollection.reduce() ), স্পেস ( image.reduceRegion() , aggregate_image.reduceNeighborhood() ), ব্যান্ড ( image.reduce() ), বা FeatureCollection ( featureCollection.reduceColumns() বা FeatureCollection পদ্ধতি যা শুরু হয় এর অ্যাট্রিবিউট স্পেস।
Reducers ইনপুট এবং আউটপুট আছে
হ্রাসকারীরা একটি ইনপুট ডেটাসেট নেয় এবং একটি একক আউটপুট তৈরি করে। যখন একটি মাল্টি-ব্যান্ড ইমেজে একটি একক ইনপুট রিডুসার প্রয়োগ করা হয়, তখন আর্থ ইঞ্জিন স্বয়ংক্রিয়ভাবে রিডুসারের প্রতিলিপি করে এবং প্রতিটি ব্যান্ডে আলাদাভাবে প্রয়োগ করে। ফলস্বরূপ, আউটপুট ইমেজ ইনপুট ইমেজ হিসাবে একই সংখ্যক ব্যান্ড আছে; আউটপুটে প্রতিটি ব্যান্ড হল ইনপুট ডেটাতে সংশ্লিষ্ট ব্যান্ড থেকে পিক্সেলের হ্রাস। কিছু হ্রাসকারী ইনপুট ডেটাসেটের টুপল নেয়। এই হ্রাসকারীগুলি প্রতিটি ব্যান্ডের জন্য স্বয়ংক্রিয়ভাবে প্রতিলিপি করা হবে না। উদাহরণস্বরূপ, ee.Reducer.LinearRegression() একটি নির্দিষ্ট ক্রমে একাধিক ভবিষ্যদ্বাণীকারী ডেটাসেট (রিগ্রেশনে স্বাধীন ভেরিয়েবলের প্রতিনিধিত্ব করে) নেয় ( রিগ্রেশন রিডিউসার্স দেখুন)।
কিছু রিডুসার একাধিক আউটপুট তৈরি করে, যেমন ee.Reducer.minMax() , ee.Reducer.histogram() বা ee.Reducer.toList() । যেমন:
এটি ইনপুটগুলির ব্যান্ডের দ্বিগুণ সংখ্যা সহ একটি আউটপুট তৈরি করবে, যেখানে আউটপুটে ব্যান্ডের নামগুলিতে ব্যান্ডের নামের সাথে '_min' বা '_max' যুক্ত থাকে।
আউটপুট প্রকার গণনার সাথে মিলিত হওয়া উচিত। উদাহরণস্বরূপ, একটি ImageCollection এ প্রয়োগ করা একটি রিডুসার একটি Image আউটপুট আছে। যেহেতু আউটপুটটিকে একটি পিক্সেল মান হিসাবে ব্যাখ্যা করা হয়েছে, তাই আপনাকে অবশ্যই একটি ImageCollection কমাতে একটি সংখ্যাসূচক আউটপুট সহ রিডুসার ব্যবহার করতে হবে ( toList() বা histogram() এর মতো হ্রাসকারীরা কাজ করবে না)।
Reducers ওজনযুক্ত ইনপুট ব্যবহার
ডিফল্টরূপে, পিক্সেল মানগুলির উপর হ্রাসগুলি তাদের মুখোশ দ্বারা ওজন করা হয়, যদিও এই আচরণটি পরিবর্তন করা যেতে পারে ( ওজন বিভাগ দেখুন)। 0 এর সমান মাস্ক সহ পিক্সেল হ্রাসে ব্যবহার করা হবে না।
হ্রাসকারী সমন্বয়
যদি আপনার উদ্দেশ্য একই ইনপুটগুলিতে একাধিক রিডুসার প্রয়োগ করা হয়, তবে দক্ষতার জন্য রিডুসারগুলিকে combine() ভাল অনুশীলন। বিশেষভাবে, sharedInputstrue সেট করে একটি রিডুসারে combine() কল করার ফলে ডেটার উপর শুধুমাত্র একটি পাস হবে। উদাহরণস্বরূপ, একটি ছবিতে পিক্সেলের গড় এবং মানক বিচ্যুতি গণনা করতে, আপনি এইরকম কিছু ব্যবহার করতে পারেন:
আউটপুটে, লক্ষ্য করুন যে রিডুসার আউটপুটগুলিকে আলাদা করার জন্য ইনপুটগুলির নামের সাথে হ্রাসকারীর নাম যুক্ত করা হয়েছে। এই আচরণটি ইমেজ আউটপুটের ক্ষেত্রেও প্রযোজ্য, যেখানে আউটপুট ব্যান্ডের নামের সাথে রিডুসারের নাম যুক্ত থাকবে।
আপনি যদি ওজনহীন ইনপুট ব্যবহার করে রিডুসার এবং ওয়েটেড ইনপুট ব্যবহার করে রিডুসারকে একত্রিত করছেন, তাহলে সমস্ত ওজনযুক্ত ইনপুট অবশ্যই সমস্ত ওজনহীন ইনপুটগুলির আগে হতে হবে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eReducers in Earth Engine aggregate data over time, space, bands, arrays, and other data structures, using methods like \u003ccode\u003ereduceRegion()\u003c/code\u003e and \u003ccode\u003ereduce()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eReducers can calculate simple statistics (e.g., mean, minimum) or more complex summaries (e.g., histograms, linear regressions) on images, image collections, and feature collections.\u003c/p\u003e\n"],["\u003cp\u003eWhen applied to multi-band images, single input reducers are automatically applied to each band, producing an output with the same number of bands.\u003c/p\u003e\n"],["\u003cp\u003eReducers can be combined using \u003ccode\u003ecombine()\u003c/code\u003e for efficient processing, allowing multiple calculations in a single pass over the data.\u003c/p\u003e\n"],["\u003cp\u003eBy default, pixel values in reductions are weighted by their mask, meaning pixels with a mask of 0 are excluded from the calculation.\u003c/p\u003e\n"]]],[],null,["# Reducer Overview\n\nReducers are the way to aggregate data over time, space, bands, arrays and other data\nstructures in Earth Engine. The `ee.Reducer` class specifies how data is\naggregated. The reducers in this class can specify a simple statistic to use for the\naggregation (e.g. minimum, maximum, mean, median, standard deviation, etc.), or a more complex\nsummary of the input data (e.g. histogram, linear regression, list). Reductions may occur over\ntime (`imageCollection.reduce()`), space (`image.reduceRegion()`,\n`image.reduceNeighborhood()`), bands (`image.reduce()`), or the\nattribute space of a `FeatureCollection` (`featureCollection.reduceColumns()`\nor `FeatureCollection` methods that start with `aggregate_`).\n\nReducers have inputs and outputs\n--------------------------------\n\n\nReducers take an input dataset and produce a single output. When a single input reducer is\napplied to a multi-band image, Earth Engine automatically replicates the reducer and applies\nit separately to each band. As a result, the output image has the same number of bands as the\ninput image; each band in the output is the reduction of pixels from the corresponding band in\nthe input data. Some reducers take tuples of input datasets. These reducers will not be\nautomatically replicated for each band. For example,\n`ee.Reducer.LinearRegression()` takes multiple predictor datasets (representing\nindependent variables in the regression) in a particular order (see\n[Regression reducers](/earth-engine/guides/reducers_regression)).\n\n\nSome reducers produce multiple outputs, for example `ee.Reducer.minMax()`,\n`ee.Reducer.histogram()` or `ee.Reducer.toList()`. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load and filter the Sentinel-2 image collection.\nvar collection = ee.ImageCollection('COPERNICUS/S2_HARMONIZED')\n .filterDate('2016-01-01', '2016-12-31')\n .filterBounds(ee.Geometry.Point([-81.31, 29.90]));\n\n// Reduce the collection.\nvar extrema = collection.reduce(ee.Reducer.minMax());\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Load and filter the Sentinel-2 image collection.\ncollection = (\n ee.ImageCollection('COPERNICUS/S2_HARMONIZED')\n .filterDate('2016-01-01', '2016-12-31')\n .filterBounds(ee.Geometry.Point([-81.31, 29.90]))\n)\n\n# Reduce the collection.\nextrema = collection.reduce(ee.Reducer.minMax())\n```\n\n\nThis will produce an output with twice the number of bands of the inputs, where band names in\nthe output have '_min' or '_max' appended to the band name.\n\n\nThe output type should match the computation. For example, a reducer applied to an\n`ImageCollection` has an `Image` output. Because the output is\ninterpreted as a pixel value, you must use reducers with a numeric output to reduce an\n`ImageCollection` (reducers like `toList()` or\n`histogram()` won't work).\n\nReducers use weighted inputs\n----------------------------\n\n\nBy default, reductions over pixel values are weighted by their mask, though this behavior can\nbe changed (see the [Weighting section](/earth-engine/guides/reducers_weighting)). Pixels with mask\nequal to 0 will not be used in the reduction.\n\nCombining reducers\n------------------\n\n\nIf your intent is to apply multiple reducers to the same inputs, it's good practice to\n`combine()` the reducers for efficiency. Specifically, calling\n`combine()` on a reducer with `sharedInputs` set to\n`true` will result in only a single pass over the data. For example, to compute the\nmean and standard deviation of pixels in an image, you could use something like this:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Load a Landsat 8 image.\nvar image = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318');\n\n// Combine the mean and standard deviation reducers.\nvar reducers = ee.Reducer.mean().combine({\n reducer2: ee.Reducer.stdDev(),\n sharedInputs: true\n});\n\n// Use the combined reducer to get the mean and SD of the image.\nvar stats = image.reduceRegion({\n reducer: reducers,\n bestEffort: true,\n});\n\n// Display the dictionary of band means and SDs.\nprint(stats);\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Load a Landsat 8 image.\nimage = ee.Image('LANDSAT/LC08/C02/T1/LC08_044034_20140318')\n\n# Combine the mean and standard deviation reducers.\nreducers = ee.Reducer.mean().combine(\n reducer2=ee.Reducer.stdDev(), sharedInputs=True\n)\n\n# Use the combined reducer to get the mean and SD of the image.\nstats = image.reduceRegion(reducer=reducers, bestEffort=True)\n\n# Display the dictionary of band means and SDs.\ndisplay(stats)\n```\n\n\nIn the output, note that the names of the reducers have been appended to the names of the\ninputs to distinguish the reducer outputs. This behavior also applies to image outputs, which\nwill have the name of the reducer appended to output band names.\n\n\nIf you are combining reducers using unweighted inputs and reducers using weighted inputs, all\nweighted inputs must be before all unweighted inputs."]]