View source: R/default_distance_thresholds.R
| default_distance_thresholds | R Documentation |
Generates four evenly-spaced distance thresholds for spatial predictor generation, ranging from 0 to half the maximum distance in the matrix.
default_distance_thresholds(distance.matrix = NULL)
distance.matrix |
Numeric distance matrix (typically square and symmetric). Default: |
The maximum threshold is set to half the maximum distance to avoid spatial predictors based on distances that are too large to capture meaningful spatial autocorrelation. The four thresholds are evenly spaced using seq() with length.out = 4.
Numeric vector of length 4 with distance thresholds (floored to integers).
Other preprocessing:
auto_cor(),
auto_vif(),
case_weights(),
double_center_distance_matrix(),
is_binary(),
make_spatial_fold(),
make_spatial_folds(),
the_feature_engineer(),
weights_from_distance_matrix()
data(plants_distance)
thresholds <- default_distance_thresholds(
distance.matrix = plants_distance
)
thresholds
# Example output: c(0, 3333, 6666, 10000)
# Four evenly-spaced thresholds from 0 to max(plants_distance)/2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.