0

I have a pipeline and like this that I pass to GridSearchCV, how can I access the attributes of the scaler from clf?

pipe = Pipeline([
        ('scale', MinMaxScaler()),
        ('clf', tree.DecisionTreeClassifier(presort=True))
    ])

pipe_param_grid = {
            'clf__min_samples_split': [2, 4, 6],
            'clf__random_state': [38, 40, 42, 44],
            'clf__max_depth': [4],
            'clf__min_samples_leaf': [2, 4],
          }

clf = GridSearchCV(estimator=pipe,param_grid=pipe_param_grid)
  • Python: 2.7.10
  • scikit-learn: 0.18.1

1 Answer 1

1

Figured it out. I can access the step attributes like this:

clf.best_estimator_.named_steps['scale'].scale_ 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.