# Earth Engine: minimumDistance classifier in regression mode

The minimumDistance classifier in GEE uses the nearest neighbor procedure to predict a class (in classification mode) or a real value (in regression mode). The parameter "Knearest" set by the user is the number (K) of neighbors to use. I understand that in classification mode it gives the class ID of each of the K neighbors, it's very clear, and after I can use Mode to estimate the class. But in regression mode, the notice says that it gives a "distance to the nearest class center". Strange ... Where can I find the coordinates of each class centers ? Why to not give the real value of the K nearest neighbors ! It would be more easy to average those values and find the prediction !!!! How can I fix this problem ?

My Javascript code is below:

``````
// Create a bounding rectangle for the entire planet

var unboundedGeo = ee.Geometry.Rectangle([-180, -88, 180, 88], "EPSG:4326", false);

// Prepare the feature collection of points

var inputtedFeatureCollection = ee.FeatureCollection('users/romainwalcker/XXXXXXX_run1');

// Make a compositeOfInterest of selected covariates (This section is hided because not interesting)

// Making the composite bands of covariates

// Choose the bands of interest from the composite
var listOfVars = ['bio12','lai','moist','soc','vpd','sand'];

// Input the name of the property of interest
var propertyToPredictAsString = 'log_pp';

// Sample the image
var trainingData = compositeOfInterest.sampleRegions({
collection: inputtedFeatureCollection,
scale:927.6624232772797
});

// Classify and display the final image
var finalClassifiedImage = compositeOfInterest.classify(ee.Classifier.minimumDistance({
metric: 'euclidean',
kNearest: 5,
})
.setOutputMode('REGRESSION')
.train(trainingData, propertyToPredictAsString, listOfVars));

``````

In the inspector, my result stored in finalClassifiedImage is: 0:122.60172485474355 1:452.04783495770914 2:459.52036616946293 3:575.6726571970663 4:744.0845882199577

How can I predict my value (ranging between 0 and 15) with those values ?

``````var reducer = ee.Reducer.mean().repeat(listOfVars.length)