Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction In this assignment, you will be modifying the Python script assignment1.py to explore the supervised learning process. This script loads the California house prices
Introduction In this assignment, you will be modifying the Python script assignment1.py to explore the supervised learning process. This script loads the "California house prices" dataset, splits the data into training and testing (initially 20% for testing), trains a linear regression model, and provides the training and testing error. Modifications For this assignment, you will make two main changes to the program. In any experimental procedure, it is best to run multiple independent trials under the same conditions (e.g., dataset, algorithm parameters) and average the results per trial (This is important because the evaluation results can change quite a bit every time you run a ML algorithm). To do this, you will have to create a for loop that contains Steps 3-9 and then averag the training and validation scores before moving onto Step 10 . Averaging results can be done either by creating arrays of each variable and finding the mean of each or (more easily) by adding the results using += during each trial and then dividing by the number of trials after the for loop has ended. Secondly, you will need to tweak the percent of data used for testing (the rest is used for training) to get the lowest possible training and testing error. This can be done by changing the test_size variable in Step 3. By default, it is set to .2, meaning that 20% of the samples are used for testing
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