Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 2 . 8 LAB: Using the DecisionTreeClassifier ( ) on the NBA data Construct a decision tree to classify whether an NBA team won
LAB: Using the DecisionTreeClassifier on the NBA data Construct a decision tree to classify whether an NBA team won or lost a game based on the team's points in the game, elo score entering the game, and win equivalence. Read nbaallelologcsv into a data frame. Subset the data containing pts eloi and winequivalent. Subset the data containing the labels, which are in the feature gameresult. Standardize the data. Split the data into train and test sets. Use DecisionTreeClassifier to initialize a classification tree using the train data. Use the classification tree to predict the results for the test data. Construct and print the confusion matrix. Ex: If only pts and eloi are used, the output is:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started