MLSampling 0.0.3.9000 (development version)
Work towards a CRAN submission. R CMD check --as-cran went from 1 ERROR / 5 WARNINGs / 4 NOTEs to 1 ERROR / 1 WARNING / 2 NOTEs.
Packaging
DESCRIPTIONnow usesAuthors@R. The maintainer had been recorded as “Carlos”, a first name only, which CRAN rejects.Removed the
Remotesfield.pryris on CRAN, so the field was never needed and it was pushingpryrout of the mainstream repositories.Moved 14 never-referenced packages from
ImportstoSuggests, leaving 12.ggplot2andviridisstay inImportsbecause they are used throughimport()inNAMESPACE. Declaredunits, which is called invalidate_field_boundary_geometry()but was missing.Dropped
quickcheck, which is archived on CRAN, and the obsoleteTypeandLazyDatafields.
Bug fixes
Escaped the non-ASCII characters in
benchmarking.Randdata-validation.R. Rendered output is unchanged.Declared
dist(),na.omit(),setNames(),head()andpackageVersion(), previously reported as undefined globals.
MLSampling 0.0.3
Bug fixes
- Random Forest classification works again.
calculate_spatial_features()computed the spatial lag asweights %*% values, which fails for a factor target, andspatial_autocorrdefaults toTRUE, so classification failed under the default configuration. A factor target now produces the neighbourhood class composition instead: onespatial_lag_<level>column per level holding the inverse distance weighted proportion of neighbours in that class. Numeric targets keep the singlespatial_lagcolumn and are unchanged.
Testing
- The Random Forest property tests no longer wrap their assertions in
tryCatch(), which was turning expectation failures into informational messages and reporting a passing suite. This had been masking both the classification failure above and the covariate assertion on the feature importance table.
MLSampling 0.0.2
Impact on existing results
Models fitted with version 0.0.1 were trained without any environmental covariates, and when target_variable was left unset they were trained against a spatial coordinate rather than the measured property. Any result produced with 0.0.1 should be regenerated with this version.
Bug fixes
Covariate extraction no longer discards the first covariate.
terra::extract()returns anIDcolumn only forSpatVectorinput, but every call site passes a coordinate matrix, so the unconditional[, -1, drop = FALSE]removed a real covariate instead. With a single-layer raster the feature set was emptied entirely and the models trained on no covariates at all. Fixed in the Random Forest, Bayesian Deep Learning and design comparison modules.Random Forest no longer trains on the
xcoordinate. Whentarget_variablewas not supplied,prepare_training_data()kept thexandycolumns in the sample data, so the automatic target detection selectedxas the value to model.Bayesian Deep Learning carried the same defect in its own
prepare_training_data()and is fixed the same way. Coordinates remain available as model features throughspatial_encoding; only the target selection changed.Hyperparameter tuning no longer yields
mtry = 0for a single-covariate feature set, whichrandomForestsilently reset whileconfig_usedreported the unusable value.
