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!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...