Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

Using Python,

Create a k-fold cross validation code with the number of folds being 10.
  1. The raw data needs to be split into training and testing.
  2. The number of folds is the number of times you should go through a for loop.
  3. Inside of the for loop, index into your raw data to pull out training and testing data based on the fold (think about how the folds are organized and how much data is in each fold, which is based on the total number of folds)
  4. Do normal linear regression model fitting
  5. Keep track of the R^2 scores of the folds
  6. Print the average and standard deviation of the R^2 value for the different folds
[画像:Our libraries that we are importing: # 1a. Importing all the libraries necessary for this assignment import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression [7] # 1b. Loading the data data = sns.load_dataset('geyser') Let's check out this dataset. [9] print(' data 1 duration waiting kind 3.600 79 long 1 1.800 54 short 2 3.333 74 long 3 2.283 62 short 4 4.533 85 long 267 4.117 81 long 268 2.150 46 short 269 4.417 90 long 270 1.817 46 short 271 4.467 74 long 272 rows x 3 columns Imagine working at Yellowstone National Park as a scientist researching Old Faithful Geyser. The boss wants us to evaluate the predictiveness of the relationship between duration of an eruption in minutes ("duration") and the duration in minutes until the next eruption ("waiting"). We collected the data, but the internet in Yellowstone is not very good, so we cannot access the crossvalidation library in python ]
expand button
Transcribed Image Text:Our libraries that we are importing: # 1a. Importing all the libraries necessary for this assignment import seaborn as sns import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression [7] # 1b. Loading the data data = sns.load_dataset('geyser') Let's check out this dataset. [9] print(' data 1 duration waiting kind 3.600 79 long 1 1.800 54 short 2 3.333 74 long 3 2.283 62 short 4 4.533 85 long 267 4.117 81 long 268 2.150 46 short 269 4.417 90 long 270 1.817 46 short 271 4.467 74 long 272 rows x 3 columns Imagine working at Yellowstone National Park as a scientist researching Old Faithful Geyser. The boss wants us to evaluate the predictiveness of the relationship between duration of an eruption in minutes ("duration") and the duration in minutes until the next eruption ("waiting"). We collected the data, but the internet in Yellowstone is not very good, so we cannot access the crossvalidation library in python
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    Computer Networking: A Top-Down Approach (7th Edi...
    Computer Engineering
    ISBN:9780133594140
    Author:James Kurose, Keith Ross
    Publisher:PEARSON
    Text book image
    Computer Organization and Design MIPS Edition, Fi...
    Computer Engineering
    ISBN:9780124077263
    Author:David A. Patterson, John L. Hennessy
    Publisher:Elsevier Science
    Text book image
    Network+ Guide to Networks (MindTap Course List)
    Computer Engineering
    ISBN:9781337569330
    Author:Jill West, Tamara Dean, Jean Andrews
    Publisher:Cengage Learning
    Text book image
    Concepts of Database Management
    Computer Engineering
    ISBN:9781337093422
    Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
    Publisher:Cengage Learning
    Text book image
    Prelude to Programming
    Computer Engineering
    ISBN:9780133750423
    Author:VENIT, Stewart
    Publisher:Pearson Education
    Text book image
    Sc Business Data Communications and Networking, T...
    Computer Engineering
    ISBN:9781119368830
    Author:FITZGERALD
    Publisher:WILEY