#' @import stats
phv_pred <-
function(
testset
,model
,dir=''
,output_name='pred.csv'
){
print('testset is test_*')
testset %>%
ungroup %>%
# unless
# Error in mutate_impl(.data, dots) : Column `predicition` must be length 11808 (the group size) or one, not 46571
select(id) %>%
mutate(
predicition =
# 我也是醉了,prediction
testset %>%
select(-id,-t) %>%
as.matrix %>%
predict(model,.) %>%
`-`(100)
# length()
# 46571
# round(.,1)
) %>%
readr::write_excel_csv(
file.path(
'data'
,paste(today() %>% stringr::str_remove_all('-') %>% stringr::str_sub(3,-1),'jiaxiang_prediction_xgboostbaseline_tweedie.csv',sep='_')
)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.