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!

The All New Performance Insights for Splunk

Splunk gives you amazing tools to analyze system data and make business-critical decisions, react to issues, ...

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...