You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does DiCE support this kind of model?
When trying to initialize it in this way :
d = dice_ml.Data(dataframe=train, continuous_features=numeric_cols.tolist(), outcome_name='label')
m = dice_ml.Model(model=opt.best_estimator_, backend="sklearn")
#Initializing DiCE object
exp = dice_ml.Dice(d, m, method="random")
I get the below error:
Is it because DiCE does not support the skorch wrapper?
Thank you!
The text was updated successfully, but these errors were encountered:
Hello!
I have trained an ML pipeline for a pytorch model by using the skorch wrapper like this:
nn = NeuralNetBinaryClassifier(nn_model,criterion=nn.BCELoss(),optimizer=torch.optim.AdamW, max_epochs=10, batch_size=32,verbose=False)
numerical_transformer = Pipeline([
('scaler', StandardScaler())
])
label_encoded_transformer = Pipeline([
('label_encoder', OrdinalEncoder())
])
one_hot_encoded_transformer = Pipeline([
('one_hot_encoder', OneHotEncoder())
])
preprocessor = ColumnTransformer(
transformers=[
('num', numerical_transformer,numeric_columns),
# ('label',label_encoded_transformer,label_encoded_features),
('one_hot', one_hot_encoded_transformer, cat_columns)
])
params = {
"Model__lr": [0.001, 0.01, 0.1],
"Model__batch_size": (16,64), # Different batch sizes
"Model__optimizer": [AdamW, Adam,SGD], # Different optimizers
"preprocessor__num__scaler": [StandardScaler(), MinMaxScaler(),RobustScaler()]
}
ml_pipeline = Pipeline([("preprocessor", preprocessor),
('float32', FunctionTransformer(func=convert_to_float32)),
("Model", nn)])
optimizer = GridSearchCV(ml_pipeline,param_grid=params,optimization_algorithm='grid_search')
opt = optimizer.fit(train,train_labels)
Does DiCE support this kind of model?
When trying to initialize it in this way :
d = dice_ml.Data(dataframe=train, continuous_features=numeric_cols.tolist(), outcome_name='label')
m = dice_ml.Model(model=opt.best_estimator_, backend="sklearn")
#Initializing DiCE object
exp = dice_ml.Dice(d, m, method="random")
I get the below error:
Is it because DiCE does not support the skorch wrapper?
Thank you!
The text was updated successfully, but these errors were encountered: