Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
Switch to YAML config files; add model pickles
Browse files Browse the repository at this point in the history
See issues #26, #29, #30
  • Loading branch information
ceholden committed Aug 21, 2015
1 parent 2660f47 commit 0666937
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 240 deletions.
32 changes: 32 additions & 0 deletions examples/classifiers/RandomForest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Default configuration file for Random Forest algorithm
#
# See sklearn implementation API here:
# http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html

# Specify algorithm and hyperparameters
algorithm: RandomForest
# Number of trees in forest
n_estimators: 500
# Criterion for qualify of split ['gini', 'entropy']
criterion: "gini"
# number of features tried at each node
max_features: "auto"
# maximum depth of tree
max_depth:
# minimum number of samples required to split an internal node
min_samples_split: 2
# minimum number of samples in newly created leaves
min_samples_leaf: 1
# maximum leaf nodes -- if not None max_depth is ignored
max_leaf_nodes:
# Use bootstrap sample
bootstrap: True
# use out-of-bag sample for generalization error
oob_score: True
# number of jobs in parallel for fit and predict
n_jobs: 1

# Algorithm fit parameters
fit:
# Sample weights for training data
sample_weight:
103 changes: 0 additions & 103 deletions examples/p022r049_example.ini

This file was deleted.

102 changes: 102 additions & 0 deletions examples/p022r049_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Example configuration file for YATSM
# As of v0.5.0, config files are to be written in YAML
#
# Quotes around strings are optional, but encouraged, except where the leading
# character would produce a parsing error (e.g., when writing the
# date_format, "%Y%j")

version: "0.5.0"

dataset:
# Text file containing dates and images
input_file: "/home/ceholden/Documents/yatsm/examples/p022r049_input.csv"
# Input date format
date_format: "%Y%j"
# Output location
output: "/home/ceholden/Documents/landsat_stack/p022r049/images/YATSM"
# Output file prefix (e.g., [prefix]_[line].npz)
output_prefix: "yatsm_r"
# Total number of bands
n_bands: 8
# Mask band (e.g., Fmask)
mask_band: 8
# List of integer values to mask within the mask band
mask_values: [2, 3, 4, 255]
# Valid range of non-mask band data
# specify 1 range for all bands, or specify ranges for each band
valid_range: [0, 10000]
# Indices for multi-temporal cloud masking (indexed on 1)
green_band: 2
swir1_band: 5
# Use BIP image reader? If not, use GDAL to read in
use_bip_reader: true
# Directory location for caching dataset lines
cache_line_dir: "/home/ceholden/Documents/landsat_stack/p022r049/images/.yatsm_cache"

# Parameters common to all timeseries analysis models within YATSM package
YATSM:
algorithm: "CCDCesque"
prediction: "LassoCV"
design_matrix: "1 + x + harm(x, 1)"
reverse: False
robust: False
commission_alpha:

# Parameters for CCDCesque algorithm -- referenced by "algorithm" key in YATSM
CCDCesque:
consecutive: 5
threshold: 3.0
min_obs: 16
min_rmse: 150
test_indices: 2, 4, 5
retrain_time: 365.25
screening: RLM
screening_crit: 400.0
slope_test: False
remove_noise: True
dynamic_rmse: False

# Regression estimator
LassoCV:
pickle: "/home/ceholden/Documents/yatsm/examples/regression/LassoCV_n100_alpha_0-50.pkl"

# Section for phenology fitting
phenology:
calc_pheno: False
# Specification for dataset indices required for EVI based phenology monitoring
red_index: 2
nir_index: 3
blue_index: 0
# Scale factor for reflectance bands
scale: 0.0001
# You can also specify index of EVI if contained in dataset to override calculation
evi_index:
evi_scale:
# Number of years to group together when normalizing EVI to upper and lower percentiles
year_interval: 3
# Upper and lower percentiles of EVI used for max/min scaling
q_min: 10
q_max: 90

# Section for segmentation
segment:
# Segmentation image
segmentation:
# Resegmentation threshold (0 turns off resegmentation)
resegment_crit: 0
# Resegmentation size thresholds
resegment_minpix: 5
resegment_maxpix: 50

# Section for training and classification
classification:
# Training data file
training_image: "/home/ceholden/Documents/yatsm/examples/training_data.gtif"
# Training data masked values
roi_mask_values: [0, 255]
# Date range
training_start: "1999-01-01"
training_end: "2001-01-01"
training_date_format: "%Y-%m-%d"
# Cache X feature input and y labels for training data image into file?
cache_training:
103 changes: 0 additions & 103 deletions examples/p035r032_example.ini

This file was deleted.

Loading

0 comments on commit 0666937

Please sign in to comment.