使用糖尿病数据集的sklearn
中有一个不错的example of linear regression。
我复制了笔记本版本,并在Jupyterlab中玩了一下。当然,它的工作原理与示例相同。但我想知道我真正看到的是什么。
因此,我试用了ipython / jupyter提供的出色功能:
diabetes.DESCR
Diabetes dataset
================
Notes
-----
Ten baseline variables, age, sex, body mass index, average blood
pressure, and six blood serum measurements were obtained for each of
n = 442 diabetes patients, as well as the response of interest, a
quantitative measure of disease progression one year after baseline.
Data Set Characteristics:
:Number of Instances: 442
:Number of Attributes: First 10 columns are numeric predictive values
:Target: Column 11 is a quantitative measure of disease progression one year after baseline
:Attributes:
:Age:
:Sex:
:Body mass index:
:Average blood pressure:
:S1:
:S2:
:S3:
:S4:
:S5:
:S6:
Note: Each of these 10 feature variables have been mean centered and scaled by the standard
deviation times `n_samples` (i.e. the sum of squares of each column totals 1).
Source URL:
http://www4.stat.ncsu.edu/~boos/var.select/diabetes.html
For more information see:
Bradley Efron, Trevor Hastie, Iain Johnstone and Robert Tibshirani (2004)
"Least Angle Regression," Annals of Statistics (with discussion), 407-499.
(http://web.stanford.edu/~hastie/Papers/LARS/LeastAngle_2002.pdf)'
从源URL转到原始raw data,它是制表符分隔的非标准化数据副本。它还进一步说明了问题域中的“ S”功能是什么。
但是我真正的问题是sklearn
中是否有一种方法可以确定
或者这仅仅是线性回归的证明?
答案 0 :(得分:1)
在规范化之前,如果没有有关数据的任何信息,就无法对数据进行规范化。但是,请注意sklearn.preprocessing
类MinMaxScaler
,StandardScaler
等确实包含inverse_transform
方法(example),因此示例中也提供了此方法。这很容易做到。就像您所说的那样,这只是回归演示。