Skip to content

Module fordead.steps.step2_train_model

Functions

train_model

def train_model(
    data_directory,
    nb_min_date=10,
    min_last_date_training='2018-01-01',
    max_last_date_training='2018-06-01',
    correct_vi=False,
    path_vi=None,
    path_masks=None
)
Uses first SENTINEL dates to train a periodic vegetation index model capable of predicting the vegetation index at any date.
If there aren't nb_min_date at min_last_date_training, later dates between min_last_date_training and max_last_date_training can be used.
See details here : https://fordead.gitlab.io/fordead_package/docs/user_guides/english/02_train_model/


Parameters
----------
data_directory : str
    Path of the output directory
nb_min_date : int
    Minimum number of valid dates to compute a vegetation index model for the pixel
min_last_date_training : str
    First date that can be used for detection (format : 'YYYY-MM-DD')
max_last_date_training : str
    Last date that can be used for training (format : 'YYYY-MM-DD')
correct_vi : bool
    If True, corrects vi using large scale median vi
path_vi : str
    Path of directory containing vegetation indices for each date. If None, the information has to be saved from a previous step
path_masks : str
    Path of directory containing masks for each date.  If None, the information has to be saved from a previous step

Returns
-------