predict
Use the predict operator to make predictions for time series data. The operator will generate predictions for in-sample data and forecasts for out-sample data.
Syntax
|predict <field>+ <model> [forecast_k=<int> | conf_interval=<int> | holdback=<int> | trend=<bool> | seasonal=<bool|string> | correlate=<field>] [with <timestamp_field>]
<field>+
|
Required. Specify a comma-separated or space-separated list of numeric fields to predict. |
<model>
|
Required. Specify the model to be used for prediction. Possible options:
|
forecast_k=<int>
|
Optional. Specify the number of points to be forecast. These points are beyond the data provided, therefore, if you want to forecast 12 points in a monthly data set, you can specify If you only want to generate a prediction for in-sample data, then you can specify Default: |
conf_interval=<int>
|
Optional. Specify the confidence interval for the forecasts made by the Default: |
holdback=<int>
|
Optional. Specify a portion of data that should be withheld from the model training process. The data can be used to evaluate the model's performance. If you have 100 data points and set holdback to Default: |
correlate=<field>
|
Optional. Specify the field that can be used as exogenous data to be associated to the training model process. It must have the same number of observations as the list of fields to predict, otherwise, the training process will fail. |
trend=<bool>
|
Optional. Specify whether you want to include a trend in your prediction.
Default: |
seasonal=<bool|string>
|
Optional.
|
with <timestamp_field>
|
Optional. Specify the time field to be used in the forecast. According to the last value of this field, the forecasts will be generated using the forecast_k parameter.
It should be in the timestamp format in milliseconds. |
Usage
You can use the predict operator to predict future behavioral data using different algorithms which can give different results. This way, you can easily find the best algorithm for the data.
Note: To be able to get results, you need to provide time series data with only one frequency, otherwise, the operator will not be able to determine the frequency to use (if there are two or more) and will not generate results.
The predict operator can be an invaluable tool for forecasting and mitigating cybersecurity threats. It can be very useful when trying to forecast future time series data, or even to validate the model by comparing the predicted values with the actual values.
For each predicted field, three additional fields will be included in the results:
-
<field>_predicted: Predicted point for the specific field. -
<field>_lower: Lower limit for the confidence interval for the predicted point. -
<field>_upper: Upper limit for the confidence interval for the predicted point.
Examples
Example 1: Predict cars field using autoregressive model with confidence interval and holdback.
test_predict_table | predict cars autoregressive conf_interval=95 forecast_k=5 holdback=5 seasonal=false with time_stamp | sort time_stamp asc
Example 2: Predict field using SARIMAX model.
test_predict_table | predict cars sarimax conf_interval=95 forecast_k=5 seasonal='1,1,1,12' with time_stamp | sort time_stamp asc
Example 3: Generates hourly event count predictions using an autoregressive model trained on the OCSF event time trend.
ocsf | timetrend count as cnt span=1h | predict cnt autoregressive