-1

I'm trying to build a second dataframe in Jupyter Notebook to train a stronger model.

This is the line of code:

dtc2 = DecisionTreeClassifier(criterion = 'entropy', ccp_alpha=0.04)

I'm getting a type error:

TyperError: init() got an unexpected keyword arugment 'ccp_alpha'

Which is odd because ccp alpha should be a standard jupyter notebook keyword. Please let me know if you have any solutions! Thank you!

I tried writing:

dtc2 = DecisionTreeClassifier(criterion = 'entropy', ccp_alpha=0.04)

Which should be standard line of code to build a dataframe.

5
  • Please be kind to everyone regardless of experience level or the questions they ask. @9769953 Commented May 12, 2024 at 18:09
  • @sonofjupyter Sorry, I don't understand: what are you referring to (if anything at all)? Commented May 13, 2024 at 14:05
  • Referring to your comments. @9769953 Commented May 14, 2024 at 15:04
  • Ah, you mean my first comment. Sorry, that was just meant as a correction, but I can see that the phrasing isn't that good, and it can be interpreted differently. I'll replace it by a better version. Commented May 14, 2024 at 20:47
  • Note that ccc_alpha is not a standard Jupyter notebook keyword (in fact, Jupyter notebooks don't really have keywords). It's a parameter of the scikit-learn class DecisionTreeClassifier. Commented May 14, 2024 at 20:50

1 Answer 1

2

As per the documentation, ccp_alpha is new since version 0.22 of scikit-learn.

Double check your version of scikit-learn, and upgrade as necessary.

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.