Wolfram 语言

增强的机器学习

查找英语词频分布

计算美国宪法中出现的单词.

In[1]:=
Click for copyable input
text = ExampleData[{"Text", "USConstitution"}, "Words"]; wordCount = Values[Counts[text]];

找到单词计算的简单分布.

In[2]:=
Click for copyable input
e\[ScriptCapitalD] = FindDistribution[wordCount]
Out[2]=

将找到的分布与单词计数对比.

显示完整的 Wolfram 语言输入
In[3]:=
Click for copyable input
Show[Histogram[wordCount, {0.5, 15.5, 1}, "ProbabilityDensity", PlotLabel -> "Word Count Distribution"], DiscretePlot[PDF[e\[ScriptCapitalD], x], {x, 1, 15}, PlotStyle -> PointSize[Large], PlotLegends -> {"e\[ScriptCapitalD]"}]]
Out[3]=

相关范例

de en es fr ja ko pt-br ru