BenSliwa / LIMITS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IndexError in extractLines() in src/weka/models/LearningModel.py

tusharvan opened this issue · comments

Index error

image

The extractLines() method in src/weka/models/LearningModel.py is giving an error when called in src\weka\models\SVM.py, line 55, in parseSVMs

Specifically the following line:
lines = self.extractLines(svms[i], "showing attribute weights, not support vectors", "Number of kernel evaluations")

Upon further investigation, I found that the data in svms is an empty string which when passed to multiple splits in extractLines() creates an indexing error.

_data and its type printed before the error shows that the data sent to be parsed is an empty string:
image

Implementation details:

Any suggestions of what could be corrected? Am I missing something in the command?
I am using Weka 3.8.6 and the latest commit on the master branch of LIMITS.
Command used to test:
python cli.py -c D:/git_repos/testing_LIMITS/dataset_limits.csv -m ann,m5,rf,svm
python cli.py -r ../examples/mnoA.csv -m ann,m5,rf,svm

Both the example dataset and my dataset gives the same error.

I also had some errors where an attempt to calculate the mean of an empty array is made. I added some checks according to the TODO comments there to skip the calculation if the size is less than 1.

Thank you for your detailed request. I just made a clean checkout of the repository and tried to reproduce the error. Please check the LIMITS/src/results/cli/tmp/ folder - are there any error files?

I suspect your issue is related to linking the weka.jar file. Per default, it is assumed that there is a "WEKA/" folder that contains the weka.jar file. You have to set that up on your own or change the path to your weka.jar (defined in "src/settings/Settings.py" -> self.wekaPath)

Thank you for the speedy response. I got it working. Looking into the LIMITS/src/results/cli/tmp/ folder was a helpful hint.

I assumed that Java was installed on my system which wasn't. Even if it wasn't, Weka packs JVM into the installation which should have worked.

According to Weka's download page:

Windows

Click here to download a self-extracting executable for 64-bit Windows that includes Azul's 64-bit OpenJDK Java VM 17 (weka-3-8-6-azul-zulu-windows.exe; 133.2 MB)
This executable will install Weka in your Program Menu. Launching via the Program Menu or shortcuts will automatically use the included JVM to run Weka.

Once again, thank you for the hint! This discussion might help someone save time and efforts :)