Skip to content

v0.1.4

Compare
Choose a tag to compare
@tnigon tnigon released this 19 May 19:32
7e3b997

This update mostly supports the FeatureData and Predict classes that have a need to retrieve the training and prediction feature matrix, respectively. The features to construct can be defined in the config file via the FeatureData.group_feats key. Here is an example FeatureData.group_feats entry that generates the training feature matrix for cumulative precipitation, ET, solar radiation, and GDDs since planting:

"weather": {
    "date_origin_kwargs": {
        "table_name": "as_planted",
        "date_column": "date_plant",
        "select_extra": []
    },
    "features": [
        "sum(w.'precip_24h:mm') as 'precip_csp:mm'",
        "sum(w.'evapotranspiration_24h:mm') as 'evapotranspiration_csp:mm'",
        "sum(w.'global_rad_24h:MJ') as 'global_rad_csp:MJ'",
        "sum(w.'gdd_10C30C_2m_24h:C') as 'gdd_10C30C_2m_csp:C'"
    ]
}

Some notes:

  • date_origin_kwargs defines the table/column that contains the "origin date" (the date to begin cumulation of weather data for). In this case, the plant date will be extracted from the date_plant column of the as_planted table (via a spatial query from each relevant observation).
  • select_extra allows the user to select extra features that are present in the planting table (e.g., population, variety, etc.)
  • features allows the user to include the desired weather features. Notice this is a list of SQL text strings, each of which get added to the query dynamically.