Make predictions with a Stickleback model

sb_predict(sb, sensors)

Arguments

sb

[Stickleback] A trained Stickleback model (see Stickleback, sb_fit)

sensors

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

Value

[Predictions] The predicted events in the bio-logging sensor data sensors from a trained Stickleback model sb.

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)

# Use the model to make predictions
predictions <- sb_predict(sb, sensors_test)
predictions
#> Predictions
#>   3 deployments.
#>   With 116 predicted events.