in google earth engine, i am not able to run my code. i got an error message of "Line 18: Unrecognized arguments (Properties) to function: Image.sampleRegions(image, collection, properties, scale, projection, tileScale, geometries)"
var image = ee.ImageCollection("COPERNICUS/S2_SR")
.filterDate('2022-01-01','2022-03-30')
.filterBounds(table)
.median();
var visParamsTrue = {bands: ['B4', 'B3', 'B2'], min: 0, max: 2500, gamma: 1.1};
Map.addLayer(image.clip(table), visParamsTrue, 'Sentinel 2022');
Map.centerObject(table, 8);
//create training data
var training = Waterbody.merge(Builtup).merge(Agriculture).merge(Vegetation).merge(BarrenLand);
print(training);
var label = 'Class';
var bands = ['B2', 'B3', 'B4', 'B5'];
var input = image.select(bands);
print (input);
//overlay THE POINTS ON THE IMAGERY Training
var trainImage = input.sampleRegions({
collection: training,
Properties: label,
scale: 10,
//region: table
}).flatten();
var trainingData = trainImage.randomColumn();
var trainSet = trainingData.filter(ee.Filter.lessThan('random', 0.8));
var trainSet = trainingData.filter(ee.Filter.greaterThanOrEquals('random', 0.8));
//classification model
var classifier = ee.Classifier.smilecart().train(trainset, label, bands);
//Classify the image
var classified = input.classify(classifier);
//Define a pallete for the classification
var landcoverPallete = [
'253494',
'969696',
'FF8000',
'006837',
'000000',
];
Map.addLayer(classified.clip(table), {palette: landcoverPlaette, min:0, max:4}, 'classification CART');
this is my code code link is https://code.earthengine.google.com/b03394b859814bc185c607c847781609