R语言test_prob - predictf1 newdata =test type = responseError in matchargtype arg should be one of lp fitted fittedind mean x dataframe terms cterms ccterms adjto adjtodataframe modelframe如何解决
这个错误可能是由于您提供的'type'参数值不正确而导致的。请确保提供的'type'参数值是“lp”,“fitted”,“fitted.ind”,“mean”,“x”,“data.frame”,“terms”,“cterms”,“ccterms”,“adjto”,“adjto.data.frame”,“model.frame”中的一个。
您可以尝试使用以下代码进行预测:
test_prob <- predict(f1, newdata = test, type = "response", na.action = na.pass)
在这个代码中,我们添加了一个额外的参数'na.action = na.pass',以确保在遇到缺失值时不会出现任何错误。
原文地址: https://www.cveoy.top/t/topic/fIJJ 著作权归作者所有。请勿转载和采集!