schwilklab / skyisland-climate

Climate data and code for Sky Island project
2 stars 2 forks source link

Schwilk fix rfmodels #23

Closed dschwilk closed 8 years ago

dschwilk commented 8 years ago

Some cleaning up of the PCA and random forest models code. Main changes:

  1. loadPCAData() returns a list with all three PCA objects. TODO: consider breaking up PCAs by season. Or moving to modeling method avoiding PCA entirely. efdd524
  2. All random forest model fitting and prediction code is in random-forest.R. More of the data checking and model fitting is wrapped in functions and then the last portion of the script runs through TMIN and TMAX models for the DM. There is still some code repetition, but adding other mtn ranges will not add as much code as it would have before. I also removed the training and testing data split because we have so few sensors. But we can add it back in easily and I left the splitdf() function.
  3. The changes in 2), above, allow us to have fewer error-prone temporary variables such as "tmin2" and "tmin3" which are hard to keep track of.