Closed coockie273 closed 4 months ago
Sorry for the delay in the response,
Could you share which version are you using for Python and SurvLIMEpy's dependencies?
If you don't know how to get those, just give me the output of this code (make sure to run it in the virtual environment you are trying to use SurvLIMEpy's from!):
import importlib
import sys
def get_version(package_name):
try:
package = importlib.import_module(package_name)
version = package.__version__
print(f"{package_name} version: {version}")
except ImportError:
print(f"{package_name} is not installed.")
except AttributeError:
print(f"Could not determine the version of {package_name}.")
packages = ["numpy", "cvxpy", "scikit-survival", "scikit-learn", "pandas"]
print(f"Python version: {sys.version}\n")
for package in packages:
get_version(package)
Edit: I was able to reproduce your error using a clean Python 3.9.19 environment. Most likely some of the dependencies have changed and that is what is causing the error. We will take a look.
Thank you for bringing this up.
Thank you for your response.
I have tried to run the code with Python versions 3.9.0 and 3.10.4, and I still received the same errors.
When I ran your code, I received the following output:
Python version: 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
numpy version: 1.26.4
cvxpy version: 1.5.1
scikit-survival is not installed.
scikit-learn is not installed.
pandas version: 2.2.2
and
Python version: 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
numpy version: 1.26.4
cvxpy version: 1.4.3
scikit-survival is not installed.
scikit-learn is not installed.
pandas version: 2.2.2
Are you using Windows as your OS? It seems that this issue only arises on Windows systems, I was not able to replicate it in MacOS or Linux.
The error does not stem from SurvLIMEpy directly but it is caused by cvxpy
inner workings. There have been multiple reports of this incident:
CVXPY issue #792 CVXPY issue #958
The problem originates from numpy
sparce matrices that cvxpy
is using. I don't remember the details, but somewhere the reshape function is called with -1 parameter. Numpy
then calls np.prod
function that fails on windows machines if the integer product goes beyond 2^32.
To circumvent this problem, reduce the number of neighbours computed (num_samples). I have updated the Read.me with 500 num_samples rather than 1000 which works on my windows machine.
I will be closing this issue as it is not directly related with survlimepy
. Feel free to reopen it if the stated solution does not work for you.
Hey,
I'm trying to run an example that is described in the readme file and I am having an error.
Code: