All Apps and Add-ons

Machine Learning Toolkit: For the Forecast Time Series function, how do I forecast the output to be categories?

wb247459
New Member

The Machine Learning Toolkit has "Forecast Time Series" function, it forecasts the numerical values. How do I forecast the output to be categories? Or at least, forecast the results in integer (0 or 1) instead of decimal values?

0 Karma

aoliner_splunk
Splunk Employee
Splunk Employee

Hi wb247459,

The predict command is built for numeric data, which is not what you have. For the case of binary data {0, 1}, you could use the predict command and then map the outputs to the nearest binary value, but it's not meant for that use case, so you might see strange results. For example, it may predict an increasing trend that eventually exceeds 1 (or more).

What I think you really want is something that learns sequences of categorical values. Although the Splunk User Behavior Analytics app does learn sequences of user actions, that's not a command that you could apply to, e.g., weather data, and I'm not aware of any such command elsewhere in Splunk.

Does that answer your question (even if it's not the answer you probably wanted)?

Cheers,
- Adam

niketn
Legend

@wb247459... What is the kind of field/value you are looking at?Can you add some sample data?

Forecast time series is essentially around the Splunk predict command, so ideally I would expect anything that can be put to a timechart can be predicted as well. If you have your data that can be put to a command like the following, you can think of predicting the same with Machine Learning Toolkit as well.

 <YourBaseSearch>
| timechart count 
| predict count
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

wb247459
New Member

my sample data is something like 0,0,1,0,0,0,1,0,0,1,0,0,0,1... by the hour, the predicted values should be 0,0,1... but not decimal values such as 0.01, 0.99, etc.

another sample input would be,
_time, weather
2017-01-01 12:00 sunny
2017-01-02 12:00 rain
...
2017-04-02 12:00 cloudy
forecast the weather for the next day.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

Data Management Digest – May 2026

Welcome to the May 2026 edition of Data Management Digest!   As your trusted partner in data innovation, the ...