Ridge Regression


In [1]:
import numpy as np

In [36]:
# bring in the cancer data
cancer = np.loadtxt('../Data/prostate.txt', skiprows=1, usecols=(1,2,3,4,5,6,7,8,9))
train_idx = np.genfromtxt('../Data/prostate.txt', skiprows=1, usecols=(10), dtype='str')

# seperate cancer data into training and testing sets
train_data = cancer[train_idx == 'T', :]
test_data = cancer[train_idx != 'T', :]

# fit the training data to a ridge regression model
# predict outputs of the test data
# get residual sum of squares (RSS)
# get eigen values
# plot the RSS against eigen values

In [ ]: