【发布时间】:2020-04-26 06:22:57
【问题描述】:
这是X和y的函数
X = np.random.rand(50,1)
y = ((X.T*X)**9 +X).reshape(-1)
您如何指出数据是否存在差异?哪些参数控制方差以及如何增加或减少它? where is the variance here?
你能给我举例说明函数的变化吗..
【问题讨论】:
标签: numpy machine-learning statistics variance
这是X和y的函数
X = np.random.rand(50,1)
y = ((X.T*X)**9 +X).reshape(-1)
您如何指出数据是否存在差异?哪些参数控制方差以及如何增加或减少它? where is the variance here?
你能给我举例说明函数的变化吗..
【问题讨论】:
标签: numpy machine-learning statistics variance
在这种情况下,您可以使用np.var(my_numpy_array,ddof=1) 来计算数组的方差。
参数 ddof 来自 'Delta Degrees of Freeedom',您可以在这里阅读更多关于它们的信息:https://en.wikipedia.org/wiki/Degrees_of_freedom_(statistics)。
在您的情况下,由于 y 是根据 X 计算的,我将计算 np.var(y) 并检查以查看结果。
您认为您的数据变化足够大的阈值取决于具体情况。
【讨论】: