简体   繁体   English

在R中的nnet multinom函数中抑制收敛消息

[英]Suppress convergence message in nnet multinom function in R

I am using knitr in R to produce a document of model outputs. 我在R中使用knitr来生成模型输出的文档。 I have suppressed messages and warnings in my code chunk. 我在代码块中抑制了消息和警告。 But I still get the convergence messages. 但我仍然得到收敛信息。 I have looked for settings in the net package and in the multinom function. 我已经在net package和multinom函数中查找了设置。 Does anybody know how to suppress them? 有人知道如何抑制它们吗? I have looked on SO and on the internet. 我已经看过SO和互联网了。 Someone asked a question in 2006 but I can't get the answer returned (and I don't know if it relevant today). 有人在2006年提出了一个问题,但我无法得到答案(我不知道今天是否相关)。

I am running many models in a loop, so it gets verbose very quickly. 我在一个循环中运行很多模型,所以它很快就会变得冗长。 This also means that I can't easily put the model runs in a different chunk from the output because I am printing tables in each loop. 这也意味着我不能轻易地将模型运行放在输出的不同块中,因为我在每个循环中打印表。 An example of the output I am trying to suppress is below: 我试图压制的输出示例如下:

# weights: 10 (4 variable) initial value 2454.392816 iter 10 value 2175.558042 iter 10 value 2175.558039 final value 2175.558039 converged

I finally found a function argument called "trace" in the nnet function. 我终于在nnet函数中找到了一个名为“trace”的函数参数。 Its default is TRUE, and when set to "FALSE" the messages stop. 它的默认值为TRUE,当设置为“FALSE”时,消息将停止。 I am guessing that nnet is called by multinom. 我猜这个nnet是由multinom调用的。 Thank goodness for the ... in R so I could pass a function argument through. 谢天谢地......在R中我可以传递一个函数参数。

Hopefully this will help someone else. 希望这会帮助别人。 I didn't mean to answer my own question (but I hope that is ok). 我不是故意回答我自己的问题(但我希望没问题)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用R中的响应(nnet程序包)分离“多项式”估计 - separating `multinom` estimations by response (nnet package) in R 来自R package nnet的函数multinom如何计算多项式概率权重? - How does the function multinom from R package nnet compute the multinomial probability weights? 多项回归(不同的结果 - 相同的数据集,R与SPSS)。 nnet包 - multinom功能 - Multinomial regression (different results — same dataset, R vs SPSS). nnet package — multinom function 来自 R 的 nnet package 的 function multinom() 是否适合多项逻辑回归或泊松回归? - Does the function multinom() from R's nnet package fit a multinomial logistic regression, or a Poisson regression? 来自 nnet::multinom 的预测 - predictions from nnet::multinom 重新定义 R 的 nnet::multinom predict.multinom predict 方法以支持 type="link" - Redefining R's nnet::multinom predict.multinom predict method to support type="link" R中的nls收敛消息 - nls convergence message in R R中的多项式逻辑回归:nnet程序包中的多项式与mlogit程序包中的mlogit有何不同? - multinomial logistic regression in R: multinom in nnet package result different from mlogit in mlogit package? R:用于nnet multinom多项式的Tukey posthoc测试适用于测试多项分布的总体差异 - R: Tukey posthoc tests for nnet multinom multinomial fit to test for overall differences in multinomial distribution 如何在函数内的multinom / nnet对象上调用model.frame()? - How do you call model.frame() on a multinom/nnet object within a function?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM