pykliep
pykliep copied to clipboard
AttributeError: DensityRatioEstimator instance has no attribute '_sigma'
Traceback (most recent call last):
File "challenge.py", line 187, in
File "challenge.py", line 180, in predict
return np.dot(self._phi(X, sigma=sigma), self._alpha).reshape((X.shape[0],))
File "challenge.py", line 150, in _phi
sigma = self._sigma
AttributeError: DensityRatioEstimator instance has no attribute '_sigma'
I have same problem.
I think it needs to be initialized in the constructor first because it is out of scope?
if the runnig does not converge, this code returns without setting the _sigma, so get the error.
if len(sorted_scores) == 0:
warnings.warn('LCV failed to converge for all values of sigma.')
return self
self._sigma = sorted_scores[0][0][1]
I have some problem
I have the same problem
As @usccolumbia mentioned if the run does not converge, this code does not set _sigma variable and it throws exception. You can try larger sigmas based on your data to avoid.
What was done to solve this issue? I also get the same error. Is anyone here tried anything to fix this issue? and how did you fix it? I already tried changing the list of values (for sigma) in code to larger values such as 100