Git Product home page Git Product logo

arvum's Introduction

ML Cultivated Product

This folder contains notebooks and scripts to extract training data, train an ML model and apply to some tiles to to produce a cultivated (A11) product

Requirements

The functions to extract data for a polygon from ODC are within the dea-notebooks repo.

1. Extracting data

  1. Collect training data as shapefile
    • Labels cover LCCS classes e.g. 111, 112, 228
  2. Sample shapefile using data_sampler.ipynb to balance classes
  3. Extract training data for each feature in shapefile - extract_data_for_shp_custom.py & deaclassification_tools
    • Per pixel should give a broader distribution instead of median per feature.
    • Currently using 6 geomedian bands and 3 mads bands and some indices
    • Can include [[phenology]] as a feature.
  4. OPTIONAL: Join multiple training extraction outputs using:
    1. pr -mts' ' *.txt > training_data.txt
    2. Manually edit the hashtags out of the file
    3. awk '{$8="";print $0}' training_data.txt | sed 's/ / /' > training_data_trim.txt
      • awk removes the 8th column and sed deletes the double spaces left behind.
  5. Visualise this data using data_visualiser.ipynb

2. Training model

Model training is conducted using train_ml_model.py. This saves a dictionary containing the model and features used to train. The parameters in this script were partially tuned using a grid search cv approach.

3. Applying model

The notebook apply_ml_model_dc.ipynb loads the pickled model and applies to a number of study sites. The sites are defined in au_test_sites.yaml.

  • Transfer model to sandbox: scp [email protected]:/g/data/r78/LCCS_Aberystwyth/training_data/cultivated/2015_merged_sample/model.pickle /home/jovyan/development/livingearth_australia/models/cultivated_sklearn_model.pickle
  • Remember to export paths correctly
    • python3 setup.py install
    • export LE_LCCS_PLUGINS_PATH=/home/jovyan/development/livingearth_australia/le_plugins
    • export PYTHONPATH=/home/jovyan/dev/dea-notebooks/Scripts:/home/jovyan/development/livingearth_australia/
  • Run python3 ../../livingearth_lccs_development_tests/scripts/run_test_sites.py -o master_branches --year 2015 --level 4

arvum's People

Contributors

danclewley avatar s-m-t-c avatar tebadi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.