ValueError: could not convert string to float:<35' I am under the impression that the 'most_frequent' setting for strategy can be used on categorical data. So, I do not understand why this tries to convert a string to a float? It seems to contradict the SimpleImputer documentation. Here'...
为此,我使用了SimpleImpueter。我的代码如下: from sklearn.impute import SimpleImputer imputer = SimpleImputer(missing_values = 'nan',strategy='mean') 此代码不工作,并显示以下值错误: ValueError: Input contains NaN, infinity or a value too large for dtype('float64 浏览25提问于2019-10-11得票数...
strategy = hyperparameter_config['strategy'] fill_value = int(np.nanmax(X)) +1ifnotdataset_info.is_sparseelse0numerical_imputer =SimpleImputer(strategy=strategy, copy=False) categorical_imputer =SimpleImputer(strategy='constant', copy=False, fill_value=fill_value) transformer = ColumnTransformer( t...