| sca | R Documentation |
Builds a single Stepwise Cluster Analysis (SCA) tree model that recursively partitions the data space based on Wilks' Lambda statistic.
sca(training_data, x, y, nmin, alpha = 0.05, resolution = 1000, verbose = FALSE)
training_data |
A data.frame containing the training data |
x |
Character vector of predictor variable names |
y |
Character vector of predictant variable names |
nmin |
Minimum number of samples in a leaf node |
alpha |
Significance level for clustering (default: 0.05) |
resolution |
Resolution for splitting (default: 1000) |
verbose |
Print progress information (default: FALSE) |
An S3 object of class "sca" containing the tree model.
sce, predict, importance, evaluate
# Load example data
data(streamflow_training_10var)
data(streamflow_testing_10var)
# Define variables
Predictors <- c("Prcp","SRad","Tmax","Tmin","VP","smlt","swvl1","swvl2","swvl3","swvl4")
Predictants <- c("Flow")
# Build SCA model
sca_model <- sca(
training_data = streamflow_training_10var,
x = Predictors,
y = Predictants,
nmin = 5,
alpha = 0.05,
resolution = 1000
)
# Use S3 methods
print(sca_model)
summary(sca_model)
sca_predictions <- predict(sca_model, streamflow_testing_10var)
sca_importance <- importance(sca_model)
sca_evaluation <- evaluate(sca_model, streamflow_testing_10var, streamflow_training_10var)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.