sca: Stepwise Cluster Analysis (SCA)

View source: R/SCA.R

scaR Documentation

Stepwise Cluster Analysis (SCA)

Description

Builds a single Stepwise Cluster Analysis (SCA) tree model that recursively partitions the data space based on Wilks' Lambda statistic.

Usage

sca(training_data, x, y, nmin, alpha = 0.05, resolution = 1000, verbose = FALSE)

Arguments

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)

Value

An S3 object of class "sca" containing the tree model.

See Also

sce, predict, importance, evaluate

Examples


  # 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)


SCE documentation built on May 11, 2026, 9:07 a.m.

Related to sca in SCE...