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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...