Splunk® Machine Learning Toolkit


Acrobat logo Download manual as PDF

This documentation does not apply to the most recent version of MLApp. Click here for the latest version.
Acrobat logo Download topic as PDF

Register an algorithm

In order to use an algorithm in Splunk Machine Learning Toolkit, you have to register the algorithm in the MLTK app to make it visible to the Splunk platform.

Register the name of an algorithm

To register an algorithm, update the algos.conf file with the name of the algorithm you want to add:


This can be done using the REST API or by manual file update:

Register an algorithm name using the REST API

$ curl -k -u admin:<admin pass> https://localhost:8089/servicesNS/nobody/Splunk_ML_Toolkit/configs/conf-algos -d name="<Your new algorithm class name>"

Register an algorithm name with a manual file update

  1. Create or update algos.conf in the following directory:
  2. Add the algorithm name as a stanza, meaning within brackets, to the algos.conf file:
    [<Your new algorithm class name>]
  3. Click save.
  4. Restart Splunk Enterprise.

Implement the algorithm

To implement the algorithm, create and name a python script file (.py file) for the algorithm in:


The name of the .py file and the name of the main class in the .py file must be the same as the stanza name, the name in brackets, used in the algos.conf file. For example, [LinearRegression] for the LinearRegression algorithm.

<Your new algorithm class name>.py

The name of the algorithm class must be unique and not conflict with other names in the algos.conf file.

Last modified on 03 July, 2019
Add an algorithm
Write an algorithm class

This documentation applies to the following versions of Splunk® Machine Learning Toolkit: 2.4.0, 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 4.0.0, 4.1.0, 4.2.0, 4.3.0

Was this documentation topic helpful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters