Open bpsut opened 1 year ago
Based on the provided information, it appears that you encountered an issue with the numpy
module when using the sir.fit(X, Y)
line of code. The error message suggests that the module does not have an attribute called int
. This issue is related to a deprecation in numpy
version 1.20 where aliases for built-in types, such as np.int
, were deprecated.
To fix this issue, you can swap line 119 of the base.py
file with one of the following options:
slice_indicator = np.ones(y.shape[0], dtype=int)
slice_indicator = np.ones(y.shape[0], dtype=np.int32)
slice_indicator = np.ones(y.shape[0], dtype=np.int64)
The first option uses the built-in int
type, which is recommended. The second and third options specify the precision by using np.int32
or np.int64
respectively.
I was trying to run this
sir.fit(X, Y)
and ran into the above issue with numpy 1.24It looks like an easy fix to swap line 119 of base.py to one of the following:
slice_indicator = np.ones(y.shape[0], dtype=int)
slice_indicator = np.ones(y.shape[0], dtype=int32)
slice_indicator = np.ones(y.shape[0], dtype=int64)
Full AttributeError: