I want to interpret my model, to learn why this model gives me 1 or 0 for labels. , so i want to use plot_tree function from xgboost. My problem is a multi label classification problem; I wrote following code;
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, shuffle=True, random_state=42)
model = MultiOutputClassifier(
xgb.XGBClassifier(objective="binary:logistic",
colsample_bytree = 0.5,
gamma = 0.1
))
#Define a pipeline
pipeline = Pipeline([("preprocessing", col_transformers), ("XGB", model)])
pipeline.fit(X_train, y_train)
predicted = pipeline.predict(X_test)
xgb.plot_tree(pipeline, num_trees=4)
This code gives me the error;
'Pipeline' object has no attribute 'get_dump'
If i change the code ;
xgb.plot_tree(pipeline.named_steps["XGB"], num_trees=4)
'MultiOutputClassifier' object has no attribute 'get_dump'
How can i solve this problem?