How to find the best degree of polynomials?

前端 未结 3 638
天涯浪人
天涯浪人 2021-02-01 11:45

I\'m new to Machine Learning and currently got stuck with this. First I use linear regression to fit the training set but get very large RMSE. Then I tried using polynomial regr

3条回答
  •  逝去的感伤
    2021-02-01 12:03

    This is where Bayesian model selection comes in really. This gives you the most likely model given both model complexity and data fit. I'm super tired so the quick answer is to use the BIC (Bayesian information criterion):

    k = number of variables in the model
    n = number of observations
    sse = sum(residuals**2)
    BIC = n*ln(sse/n) + k*ln(n) 
    

    This BIC (or AIC etc) will give you the best model

提交回复
热议问题