Splunk Search

How do you get sklearn algorithm to work in Splunk?

rickyhsu7
Explorer

I have added another algorithm SVR in Splunk Enterprise with the way on the website below, and it works.
But I'm confused about the commands fit and apply.
I've read the user guide http://docs.splunk.com/Documentation/MLApp/4.0.0/User/Understandfitandapply

and https://docs.splunk.com/Documentation/MLApp/4.0.0/API/Writeanalgorithmclass.

I know SVR has fit command.

For example:
estimator = SVR()
estimator.fit(train_feature, train_label) #training process

However, I want to predict another feature "test_feature", and I must use the command below
estimator.predict(test_feature) #prediction process

Now, here is the quastion, where is the apply?

How does it works?

Could anyone help me?

0 Karma

pramit46
Contributor

@ rickyhsu7,

You fit an algorithm and apply a model.
In simple words, we apply the algorithm on our test data, then if things go well, we give a logical name to the whole thing which is model name. then when we actually have to use that model to our final dataset, we use apply.

Does it make sense?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...