'numpy.ndarray'对象没有属性'sorted_indices'

时间:2019-09-20 19:12:39

标签: numpy one-hot-encoding

我正在尝试从编码数据中检索我参考的原始数据 How to Retrieve Original Variables After Scikit Model Run w/OneHotEncoding

credentials.getAddress()

但收到错误

ohe = OneHotEncoder(categorical_features = cat, sparse=False ) X_ohe = ohe.fit_transform(fit) recovered_X = np.array([ohe.active_features_[col] for col in X_ohe.sorted_indices().indices]).reshape(284807, 30) - ohe.feature_indices_[:-1]

** fit有284807行和30列,而第29列为分类

0 个答案:

没有答案