Please enable JavaScript to use CodeHS

Introduction to Artificial Intelligence (2021)

Lesson 4.4 Training and Testing Data

Description

In this lesson, students dig deeper into how to create a more effective linear regression model by fitting a model using training data and using the remaining data as testing data. By dividing the data into training and testing subsets, students create a model that doesn’t overfit the training data and can make correct predictions when given new data.


Objective

Students will be able to:

  • Split a dataset into training and test data sets
  • Fit a linear regression model using training data
  • Evaluate the performance of a linear regression model using testing data