View source: R/create_training_data.R
create_training_data_with_buffer | R Documentation |
Given an input dataset and set of positive points, generate randomly sampled negative points and extract predictor values for positive and negative points. This sampling method is designed for a data set of positive points that is not considered a full inventory, such as the DOGAMI landslide inventory. First, we build a presumed negative region, with enough proximity to recorded landslide initiation points that we assume if a landslide had occurred there, it would have been recorded.
create_training_data_with_buffer(
positive_points,
predictors_raster,
pos_buffer = 15,
neg_buffer = 50,
analysis_region_mask = NULL,
negative_proportion = 1,
extraction_method = "centroid",
extraction_layer = NULL,
rseed = NULL
)
positive_points |
SpatVector with locations of all points with positive class; that is landslide initiation points |
predictors_raster |
SpatRaster with a layer for each predictor variable |
pos_buffer |
The radius in meters around a positive point that is considered within the landslide initiation zone; negative sample points are excluded from within this buffer |
neg_buffer |
The radius around a positive point within which we are confident that no landslides were observed; negative (nonlandslide) points are sampled from the area between the pos_buffer and neg_buffer radius. |
analysis_region_mask |
SpatRaster with data values everywhere that points can be sampled from. All locations that should be excluded from sampling should be NA. If NULL, all cells which are non-NA for all layers of the predictors_raster will be used. |
negative_proportion |
Proportion of negative points to be generated compared to number of positive points |
extraction_method |
Method to use for extracting values from each point: "all", "centroid", "max", or "min". Ignored if extractionPoints is not polygon |
extraction_layer |
Layer to use for extracting value. Ignored if extraction_method = "centroid". Ignored if extraction_method is "all" or "centroid" or if extractionPoints is not polygon. |
rseed |
Optional integer to seed the random sampling. This allows exact "random" results to be reproduced multiple times. If no number is given, a random number will be chosen as a seed. |
a data.frame with values for positive and negative points
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.