Session Ready
Exercise

Modeling the UFO dataset, part 1

In this exercise, we're going to build a k-nearest neighbor model to predict which country the UFO sighting took place in. Our X dataset has the log-normalized seconds column, the one-hot encoded type columns, as well as the month and year when the sighting took place. The y labels are the encoded country column, where 1 is us and 0 is ca.

Instructions
100 XP
  • Print out the .columns of the X set.
  • Split up the X and y sets using train_test_split(). Pass the y set to the stratify= parameter, since we have imbalanced classes here.
  • Use fit() to fit train_X and train_y.
  • Print out the .score() of the knn model on the test_X and test_y sets.