您的訂閱是我製作影片的動力
訂閱點這裡~
若內容有誤,還請留言指正,謝謝您的指教
#影片程式碼
#延續DAY20
set.seed(123)
model <- xgboost(data = trainx[,-c(4:6)],
label = trainy,
nrounds = 105,eta=0.05,
min_child_weight=3,max_depth=7,
subsample=0.8,colsample_bytree=1,
objective = "reg:squarederror",verbose = 0)
future <- predict(model,testx[,-c(4:6)])
future <- as.data.frame(future)
final <- cbind(future,testy,testx[,-c(4:6)])
final <- mutate(final,mape=abs(future-testy)/testy)
mean(final$mape)