I am trying to follow the example and fit the model but keep getting the below error
kliep = DensityRatioEstimator()
kliep.fit(X_train.values, X_test.values) # keyword arguments are X_train and X_test
weights = kliep.predict(X_train.values)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [83], in <cell line: 2>()
1 kliep = DensityRatioEstimator()
----> 2 kliep.fit(X_train.values, X_test.values) # keyword arguments are X_train and X_test
3 weights = kliep.predict(X_train.values)
File ~\Downloads\pykliep.py:85, in DensityRatioEstimator.fit(self, X_train, X_test, alpha_0)
79 j_scores[(num_param,sigma)][k-1] = self._fit(X_train=X_train,
80 X_test=X_test_fold,
81 num_parameters = num_param,
82 sigma=sigma)
83 j_scores[(num_param,sigma)] = np.mean(j_scores[(num_param,sigma)])
---> 85 sorted_scores = sorted([x for x in j_scores.iteritems() if np.isfinite(x[1])], key=lambda x :x[1], reverse=True)
86 if len(sorted_scores) == 0:
87 warnings.warn('LCV failed to converge for all values of sigma.')
AttributeError: 'dict' object has no attribute 'iteritems'
I am trying to follow the example and fit the model but keep getting the below error
My code looks like below
So, I went to the code file and replaced
iteritemswithitemsfor python 3 but that still doesn't solve the error