sb_fit.Rd
Fit a Stickleback model
sb_fit(sb, sensors, events)
[Stickleback]
A Stickleback model (see Stickleback
)
[Sensors]
Bio-logging sensor data (see
Sensors
)
[Events]
Labeled behavioral events (see Events
)
sb_fit
trains the Stickleback model sb
on the data in sensors
and events
, returning NULL
.
# 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)