Statistics and Linear Algebra 4

Posted 阿难的机器学习计划

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Statistics and Linear Algebra 4相关的知识,希望对你有一定的参考价值。

1.The way to calculate the slope: the covariance of x and y divided by the variance of x

  from numpy import cov
  slope_density = cov(wine_quality["quality"],wine_quality["density"])[0,1]/wine_quality["density"].var() #cov(x,y) is the function from numpy, which returns a 2*2 metric,.var() is pandas function.

2.To get the intercept: b = y - ax( x and y are the mean value of each column)

  intercept_density = wine_quality["quality"].mean() - wine_quality["density"].mean() * (calc_slope(wine_quality["density"],wine_quality["quality"])) 

以上是关于Statistics and Linear Algebra 4的主要内容,如果未能解决你的问题,请参考以下文章

Statistics and Linear Algebra 5

Statistics and Linear Algebra 6

Statistics and Linear Algebra 2

Statistics and Linear Algebra 3

The implementation and experimental research on an S-curve acceleration and deceleration control alg

Statistics gathering and SQL Tuning Advisor