var samples = ee.FeatureCollection('projects/gee-book/assets/A3-4/sample_with_pred_hansen_2010');
var utils = require('projects/GLANCE:ccdcUtilities/api')
var minObservations = 4;
var chiSquareProbability = 0.97;
var training = samples;
var forestValue = 1;
var startYear = 2010;
var endYear = 2020;
var classBands = ['NDFI', 'GV', 'Shade', 'NPV', 'Soil'];
var prepTraining = false;
//---------------- CODED parameters
var codedParams = {
minObservations: minObservations,
chiSquareProbability: chiSquareProbability,
training: training,
studyArea: studyArea,
forestValue: forestValue,
forestMask: forestMask,
classBands: classBands,
collection: landsat,
startYear: startYear,
endYear: endYear,
prepTraining: prepTraining
};
// -------------- Run CODED
var results = api.ChangeDetection.coded(codedParams); // api is loaded correctly and is a variable in the environment.
print(results);