Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 nbaallelo_log.csv into a data frame.
  • Subset the data containing pts, elo_i, and win_equivalent.
  • Subset the data containing the labels, which are in the feature game_result.
  • Standardize the data.
  • Split the data into 75 % train and 25 % 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 elo_i are used, the output is:
[[10317 5522] [ 5021 10719]] 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions

Question

DESCRIBE how accidents at work can be prevented .

Answered: 1 week ago

Question

lining a timeline for a project that is due march12

Answered: 1 week ago