TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Lea – Discrete probability distributions in Python

79 点作者 naftaliharris超过 10 年前

5 条评论

gamegoblin超过 10 年前
A minor grumble, but the filenames are not intuitive at all to me... It makes finding what I&#x27;m looking for a bit difficult.<p><pre><code> alea.py clea.py dlea.py flea.py ilea.py lea.py olea.py plea.py tlea.py </code></pre> Also if anyone is interested in floating point weights, look at the alias method. Good tutorial here: <a href="http://www.keithschwarz.com/darts-dice-coins/" rel="nofollow">http:&#x2F;&#x2F;www.keithschwarz.com&#x2F;darts-dice-coins&#x2F;</a><p>EDIT: User rawnlq beat me to mentioning the alias method. I second the recommendation.
johnloeber超过 10 年前
Oh, that looks <i>nice</i>. This is really great. I worked on a project a while back in which I needed to generate a discrete probability distribution, and found Python&#x27;s support for this to be lacking. I ended up having to hard-code most of the distribution and then use multipliers to cover other cases, which I found very mathematically unsatisfying.<p>Thus, I think Lea looks very helpful for certain use-cases related to discrete probability. Great!
评论 #8582383 未加载
rawnlq超过 10 年前
I was hoping to see an implementation the alias method [1] for sampling from discrete distributions! Nonetheless very cool.<p>[1] <a href="http://en.wikipedia.org/wiki/Alias_method" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Alias_method</a> or <a href="http://www.keithschwarz.com/darts-dice-coins/" rel="nofollow">http:&#x2F;&#x2F;www.keithschwarz.com&#x2F;darts-dice-coins&#x2F;</a>
sinwave超过 10 年前
I&#x27;m under way on something like this for JavaScript with a buddy of mine. <a href="https://github.com/jacobmenick/sampling/" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jacobmenick&#x2F;sampling&#x2F;</a>
mathgenius超过 10 年前
The great thing about python is that we all get to implement such a library ourselves, using our own idioms and lack of documentation and&#x2F;or unit tests.
评论 #8584506 未加载