1 回答

TA貢獻(xiàn)1798條經(jīng)驗(yàn) 獲得超3個(gè)贊
這可能是因?yàn)槟愕囊恍?coloms 無(wú)處不在NaN,我為你創(chuàng)建了一個(gè)小例子,遵循了文檔:
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
imp_mean = IterativeImputer(random_state=0)
import numpy as np
imp_mean.fit([[7, 2, np.nan], [4, np.nan, np.nan], [10, 5, np.nan]])
X = [[7, 2, np.nan], [4, np.nan, np.nan], [10, 5, np.nan]]
imp_mean.transform(X)
array([[ 7. , 2. ],
[ 4. , -0.999998],
[10. , 5. ]])
所以如果一切都是NanIterativeImputer 不知道如何適應(yīng)和轉(zhuǎn)換它。文檔中的原始示例以 (3,3) 形狀結(jié)束。
添加回答
舉報(bào)