Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo UC9.ipynb review #1

Open
3 tasks
soxofaan opened this issue Mar 29, 2022 · 0 comments
Open
3 tasks

Demo UC9.ipynb review #1

soxofaan opened this issue Mar 29, 2022 · 0 comments
Assignees

Comments

@soxofaan
Copy link

attempt to do review of Demo UC9.ipynb through a github issue:

  • avoid doing star imports (it's practically always a bad idea):

    from openeo_classification.landuse_classification import *
    
  • avoid long lines like these:

    train_test_split, algorithm, nrtrees, mtry, fusion_technique, aoi, strat_layer, start_date, end_date, nr_targets, nr_spp = getStartingWidgets()
    
    ml_model = X.fit_class_random_forest(target=json.loads(y.to_json()), training=train_test_split.value, num_trees=nrtrees.value, mtry=mtry.value)
    
    cube = features.filter_spatial(gpd.GeoDataFrame.from_features(json.loads(list(aoi.value.values())[0]["content"]))["geometry"][0])
    

    some notebook viewers (e.g. github) don't support horizontal scrolling, so you can't see the whole line

  • functions (like the ones in openeo_classification.landuse_classification) should have a "snake_case" name instead of camel/dromedaris case:

    target_classes = getTargetClasses(nr_targets)
    ...
    y = getReferenceSet(aoi, nr_spp, target_classes)
    ...
    def getStrata():
    

    should be

    target_classes = get_target_classes(nr_targets)
    ...
    y = get_reference_set(aoi, nr_spp, target_classes)
    ...
    def get_strata():
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants