Session Ready
Exercise

Fitting a simple regression model

Now we'll look at a larger number of companies. Recall that we have historical price values for many companies. Let's use data from several companies to predict the value of a test company. You'll attempt to predict the value of the Apple stock price using the values of NVidia, Ebay, and Yahoo. Each of these is stored as a column in the all_prices DataFrame. Below is a mapping from company name to column name:

ebay: "EBAY"
nvidia: "NVDA"
yahoo: "YHOO"
apple: "AAPL"

We'll use these columns to define the input/output arrays in our model.

Instructions
100 XP
  • Create the X and y arrays by using the column names provided.
  • The input values should be from the companies "ebay", "nvidia", and "yahoo"
  • The output values should be from the company "apple"
  • Use the data to train and score the model with cross-validation.