NPEL.Classification: For aiding in the processing and classification of remote...

Description Functions Sample Data Utility functions and Constants Future Expansion Warning See Also

Description

For aiding in the processing and classification of remote sensed data, and rendering of imputed maps

Functions

This package aims to aid and simplify the following tasks:

These tasks fall into six main groups with the following functions associated with each task:

  1. Read in a raster

    • readTile – read a collection of TIF files from a folder and compile them into a single raster.stack.

  2. Extract data from the raster

    • extractPoints – given a collection of spatial points (maptools), extract the raster data under them. This is allows the construction of a model linking site characteristics–most notably ecoSite–to remote sense variables.

  3. Generate Models

    • generateModels – given some data and a list of model types, create a list of models. This returns a list of models, which together can be treated as a whole using many of the analytical functions.

  4. Assess model accuracy and variable importance

    • npelVIMP – generate variable importance data for a model. This was developed as a way of finding VIMP for nearest neighbour models but has been expanded to generate VIMP data for all models included in this package using the same leave-one-out technique.

    • npelVIF – compute the variable inflation factor for a model.

    • classAcc – compute the accuracies for a specified model: class accuracies for categorical data, and R-squared for regression models.

    • modelAccs – report the accuracies and VIMP data for a list of models.

    • validate – validate a specified model, that is, use a validation dataset to determine accuracy: class accuracies for categorical data, and R-squared for regression models.

    • modelsValid – validate a list of models.

    • nnErrMap – produce a map of nearest neigbour distances or errors.

  5. Render Output

    • writeTile – generate a output raster(s) given a collection of input rasters and a single model.

    • writeTiles – generate a collection output raster given a input rasters and a list of models.

    • impute – create a map of a variable based via a lookup table and second map.

  6. Visualize the results

    • plotTile – plot a single model; doesn't work yet???

    • plotTiles – plot a list of models; doesn't work yet???

Sample Data

A small selection of data has been included in the package for didactic and testing purposes:

Utility functions and Constants

There are several other common tasks that this package aims to streamline:

Future Expansion

While this section is more theoretical, a word on adding other modelling packages to this package. Given the object oriented (OOP) nature of the implementation, adding packages should be a task comprising adding the relevant OOP code; that is, add a relevant function for every overloaded function in the package. At the time of this writing, all of these functions can be found in the file OOP_util.R.

Of course, return values need to be consistent with existing expectations. It is also necessary to update the global constants which show which packages are supported: see Constants for more information.

And finally, thorough testing... Testing code could be added to the testing suite, but it could also remain outside the package if the new functionality is only to be used locally. For that matter, extra OOP code for expanding the functionality need not be added to the package, but could remain external as long as the correct overloading are used!

Good luck and I hope this work does what you need it to do...

Warning

NPEL.Classification must be before raster on the search path; in particular getData is a valid function in both packages. If you are getting very unusual errors, consider detaching and reattaching this package so it is found first.

See Also

The code in this package depends heavily on the raster package. A couple of functions utilize maptools.

Currently supported modelling packages are: randomForest, randomForestSRC, FNN, class, kknn, and gbm.


henkelstone/NPEL.Classification documentation built on May 17, 2019, 3:42 p.m.