Fit a Stickleback model

sb_fit(sb, sensors, events)

Arguments

sb

[Stickleback] A Stickleback model (see Stickleback)

sensors

[Sensors] Bio-logging sensor data (see Sensors)

events

[Events] Labeled behavioral events (see Events)

Value

sb_fit trains the Stickleback model sb on the data in sensorsand events, returning NULL.

Examples

# Load sample data and split test/train
c(lunge_sensors, lunge_events) %<-% load_lunges()
test_deployids <- deployments(lunge_sensors)[1:3]
c(sensors_test, sensors_train) %<-% divide(lunge_sensors, test_deployids)
c(events_test, events_train) %<-% divide(lunge_events, test_deployids)

# Define a time series classifier
tsc <- compose_tsc(module = "interval_based",
                   algorithm = "SupervisedTimeSeriesForest",
                   params = list(n_estimators = 2L, random_state = 4321L),
                   columns = columns(lunge_sensors))

# Define a Stickleback model
sb <- Stickleback(tsc,
                  win_size = 50,
                  tol = 5,
                  nth = 10,
                  n_folds = 4,
                  seed = 1234)

# Fit the model to the sample data
sb_fit(sb, sensors_train, events_train)