View source: R/create_training_data.R
create_training_data_from_points | 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.
create_training_data_from_points(
positive_points,
predictors_raster,
analysis_region_mask = NULL,
buffer_radius = 15,
negative_proportion = 1,
extraction_method = "centroid",
extraction_layer = NULL,
rseed = NULL
)
positive_points |
SpatVector with locations of all points with positive class |
predictors_raster |
SpatRaster with a layer for each predictor variable |
analysis_region_mask |
SpatRaster with non-NA 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. |
buffer_radius |
minimum possible distance between a positive and negative point |
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.