This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
code:ridge_regression [2013/09/19 12:32] asa |
code:ridge_regression [2016/08/09 10:25] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Ridge Regression ===== | ===== Ridge Regression ===== | ||
+ | |||
+ | Here's code for ridge regression: | ||
<file python ridge_regression.py> | <file python ridge_regression.py> | ||
Line 92: | Line 94: | ||
Next we will read in some data taken from the UCI machine learning repository. The task is to predict | Next we will read in some data taken from the UCI machine learning repository. The task is to predict | ||
- | where in the body a CT scan is obtained from. Here's a ([[http://archive.ics.uci.edu/ml/datasets/Relative+location+of+CT+slices+on+axial+axis | link to the data]]. | + | where in the body a CT scan is obtained from. Here's a [[http://archive.ics.uci.edu/ml/datasets/Relative+location+of+CT+slices+on+axial+axis | link to the data]]. |
<code python> | <code python> | ||
data = vectorDatasets.PyVectorDataSet('../data/slice_localization_data.csv', labelsColumn = -1, numericLabels=True) | data = vectorDatasets.PyVectorDataSet('../data/slice_localization_data.csv', labelsColumn = -1, numericLabels=True) | ||
- | <code> | + | </code> |
Note that we had to tell PyML to interpret the labels as numeric. | Note that we had to tell PyML to interpret the labels as numeric. | ||