【问题标题】:How do I denormalize the sklearn diabetes dataset?如何非规范化 sklearn 糖尿病数据集?
【发布时间】:2019-02-15 11:29:33
【问题描述】:

sklearn 中有一个很好的example of linear regression 使用糖尿病数据集。

我复制了笔记本版本并在 Jupyterlab 中玩了一下。当然,它就像示例一样工作。但我想知道我真正看到的是什么。

  • 有一个带有未标记轴的图表。
  • 我想知道标签(因变量)是什么。
  • 我想知道使用了 10 个自变量中的哪一个。

所以我玩弄了 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”特征。

  • 有趣的是,性是 [1,2] 之一,人们猜测它们的含义。

但我真正的问题是sklearn 中是否有办法确定

  • 如何对 sklearn 中的数据进行非规范化处理?
  • 有没有一种方法可以对系数进行非规范化和截距,以便可以 用代数表达拟合?

或者这只是线性回归的演示?

【问题讨论】:

    标签: python scikit-learn


    【解决方案1】:

    如果没有关于规范化之前数据的任何信息,就无法对数据进行非规范化。但是,请注意 sklearn.preprocessingMinMaxScalerStandardScaler 等确实包含 inverse_transform 方法 (example),因此如果示例中也提供了这些方法,则很容易做到。就目前而言,正如您所说,这只是一个回归演示。

    【讨论】:

      猜你喜欢
      • 2020-12-06
      • 2016-06-24
      • 2019-11-11
      • 2017-06-14
      • 2010-10-06
      • 2015-07-26
      • 2017-01-14
      • 2014-12-23
      • 1970-01-01
      相关资源
      最近更新 更多