Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'OneHotEncoder' object has no attribute 'n_values_' #16

Open
Gaurav7296 opened this issue May 27, 2020 · 0 comments
Open

Comments

@Gaurav7296
Copy link

I tried serializing pipeline with mleap but it's giving error
"ColumnTransformer' object has no attribute 'op"

Below are segments from the pipline:
numeric_transformer = Pipeline(steps=[ ('imputer', SimpleImputer(strategy='median')), ('scaler', StandardScaler())])

categorical_transformer = Pipeline(steps=[
('imputer', SimpleImputer(strategy='constant', fill_value='missing')),
('onehot', OneHotEncoder(handle_unknown='ignore'))])

preprocessor = ColumnTransformer( transformers=[ ('num', numeric_transformer, numeric_features),
('cat', categorical_transformer, categorical_features), ])

mlp = MLPClassifier(hidden_layer_sizes=(8,6,1), max_iter=300,activation = 'tanh',solver='adam',random_state=123)

pipe = Pipeline([('preprocessor', preprocessor), ('mlp', mlp) ])
pipe.mlinit()

model = pipe.fit(X_train,y_train)

model.serialize_to_bundle("jar:file:/C://Users/logReg.zip")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant