All Apps and Add-ons

Splunk Machine Learning Toolkit: Added CorrelationMatrix algo but cannot import name BaseAlgo

lloydknight
Builder

Hello,

So I followed this doc below:
http://docs.splunk.com/Documentation/MLApp/2.2.0/API/CorrelationMatrix

Now I am getting this error upon following the example search:

Error in 'fit' command: (ImportError) cannot import name BaseAlgo

Below is the splunkd error in debug mode:
05-12-2017 16:22:38.972 +0800 ERROR ChunkedExternProcessor - stderr: (ImportError) cannot import name BaseAlgo
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: Traceback (most recent call last):
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: File "/appl/splunk/etc/apps/Splunk_ML_Toolkit/bin/cexc/init.py", line 127, in run
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: while self.handle_chunk():
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: File "/appl/splunk/etc/apps/Splunk_ML_Toolkit/bin/cexc/
init.py", line 254, in _handle_chunk
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: ret = self.handler(metadata, body)
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: File "/appl/splunk/etc/apps/Splunk_ML_Toolkit/bin/fit.py", line 182, in handler
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: return self.setup()
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: File "/appl/splunk/etc/apps/Splunk_ML_Toolkit/bin/fit.py", line 117, in setup
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: algos = __import
_("algos", fromlist=["*"])
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: File "/appl/splunk/etc/apps/Splunk_ML_Toolkit/bin/algos/CorrelationMatrix.py", line 1, in
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: from base import BaseAlgo
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - stderr: ImportError: cannot import name BaseAlgo
05-12-2017 16:22:38.973 +0800 ERROR ChunkedExternProcessor - Error in 'fit' command: (ImportError) cannot import name BaseAlgo

Things I already checked:
- Installed Python for Scientific Computing properly with respect to its OS architecture and not renamed it.
- Splunk runs with the same user who installed the app.

Any idea guys?

Much appreciated!

0 Karma
1 Solution

aljohnson_splun
Splunk Employee
Splunk Employee

Hello @lloydknight

Can you confirm which version of MLTK and PSC you are using? As well as Splunk Version?

While in the MLTK, go up to Help > About:

alt text

The custom algorithm documentation you link only applies to version 2.2.

Best,
Xander

View solution in original post

aljohnson_splun
Splunk Employee
Splunk Employee

Hello @lloydknight

Can you confirm which version of MLTK and PSC you are using? As well as Splunk Version?

While in the MLTK, go up to Help > About:

alt text

The custom algorithm documentation you link only applies to version 2.2.

Best,
Xander

lloydknight
Builder

CorrelationMatrix is now working. I cannot mark your answer as an answer since you made it a comment.

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

I converted it to an answer - glad to hear that it fixed your issue.

lloydknight
Builder

Holy?! Why didn't I check the version requirement! Will execute this later and provide an update. Thank you!

0 Karma
Get Updates on the Splunk Community!

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...