def earth_engine_classifier(domain, b, classifier_name, extra_args={}):
    
    # Training requires a training image plus either ground truth or training features.
    training_domain = None
    #if domain.training_domain:
    training_domain = domain.training_domain
    #elif domain.unflooded_domain:
    #training_domain = domain.unflooded_domain
    if not training_domain:
        raise Exception('Cannot run classifier algorithm without a training domain!')

    training_image  = _create_learning_image(training_domain, compute_modis_indices(training_domain))
    if training_domain.training_features:
        args = {
                'training_features' : training_domain.training_features,
                'training_property' : 'classification',
                #'crs'               : 'EPSG:32736',
                #'crs_transform'     : [0.8,0,733605.2,0,-0.8,8117589.2]
                "crs": "EPSG:4326", # TODO: What to use here???
                "crs_transform": [8.9831528411952135e-05, 0, -180, 0, -8.9831528411952135e-05, 90],
               }
    elif training_domain.ground_truth:
        args = {
                'training_image'    : training_domain.ground_truth,
                'training_band'     : "b1",
                'training_region'   : training_domain.bounds
               }
    else: # Use the permanent water mask
        args = {
                'training_image'    : get_permanent_water_mask(),
                'training_band'     : "b1",
                'training_region'   : training_domain.bounds
               }
    common_args = {
                   'image'             : training_image,
                   'subsampling'       : 0.2, # TODO: Reduce this on failure?
                   'max_classification': 2,
                   'classifier_mode' : 'classification',
                   'classifier_name'   : classifier_name
                  }
    args.update(common_args)
    args.update(extra_args)
    classifier = ee.apply("TrainClassifier", args)  # Call the EE classifier
    classified = _create_learning_image(domain, b).classify(classifier).select(['classification'], ['b1'])
    
    
    # For high resolution Skybox images, apply an additional filter step to clean up speckles.
    try:
        try: # The Skybox data can be in one of two names
            skyboxSensor = domain.skybox
        except:
            skyboxSensor = domain.skybox_nir
        classified = classified.focal_min(13, 'circle', 'meters').focal_max(13, 'circle', 'meters')
    except:
        pass
    
    return classified;
Apply EE classifier tool using a ground truth image.
dataset/ETHPy150Open nasa/CrisisMappingToolkit/cmt/modis/ee_classifiers.py/earth_engine_classifier