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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...