我之前NgramModel在nltk中使用过这个类而没有错误.但是,我最近更新了nltk到版本3.1,我再也找不到这个NgramModel类了.当我尝试像往常一样导入时:
from nltk.model import NgramModel
我收到了错误
ImportError: No module named 'nltk.model'.
有NgramModel或model模块最近更换?
我一直在 R 中使用MatchIt包来进行处理与控制匹配,但我无法获得最佳匹配来处理我自己的数据集。
如果我运行以下代码:
m.out <- matchit(match_formula, data=stats, method='optimal', distance='logit', ratio=2)
Run Code Online (Sandbox Code Playgroud)
公式在哪里
treatment ~ t_1 + t_2 + t_3 + t_4 + t_5 + t_6 + t_7 + t_8 + t_9 +
t_10 + t_11
Run Code Online (Sandbox Code Playgroud)
然后我以错误告终
Error in fullmatch.matrix(d, min.controls = ratio, max.controls = ratio, : omit.fraction must be NULL or numeric between -1 and 1
Run Code Online (Sandbox Code Playgroud)
我在matchit方法中找不到任何地方来指定 omit.fraction 变量或什至做什么。有没有办法绕过这个错误并执行最佳匹配?