Presto SQL 에서 회귀분석하기.

Presto Version

  • 0.241

선형회귀 기반 회귀계수 도출 방법

SELECT regr_intercept(y,x) intercept, regr_slope(y,x) slope
FROM (values (30,73),(20,50),(60,128),(80,170),(40,87),(50,108),(60,135),(30,69),(70,148),(60,132)) data(X,Y)

SVM 기반 선형 에측

SELECT 
	regress(features(5), model_bh_210618) AS predicted_target 
FROM
( 
	SELECT learn_regressor(y,features(x)) as model_bh_210618
    FROM  (values (30,73),(20,50),(60,128),(80,170),(40,87),(50,108),(60,135),(30,69),(70,148),(60,132)) data(X,Y) 
)