pants

机器学习之贝叶斯算法

末鹿安然 提交于 2021-02-11 15:59:07
一、贝叶斯简介   贝叶斯(约1701-1761) Thomas Bayes,英国数学家,贝叶斯方法源于他生前为解决一个“逆概”问题写的一篇文章,生不逢时,死后它的作品才被世人认可。       贝叶斯要解决的问题:   正向概率:假设袋子里面有N个白球,M个黑球,你伸手进去摸一把,摸出黑球的概率是多大?   逆向概率:如果我们事先并不知道袋子里面黑白球的比例,而是闭着眼睛摸出一个(或好几个)球,观察这些取出来的球的颜色之后,那么我们可以就此对袋子里面的黑白球的比例作出什么样的推测。   现实世界有很多问题本身就是不确定的(比如上面的逆向概率,不确定球的个数),而人类的观察能力是有局限性的,由于我们日常所观察到的只是事物表面上的结果(比如上面的逆向概率,观察取出来的球的颜色),因此我们需要提供一个猜测来得到袋子里面球的比例。 二、贝叶斯推导过程   首先引入一个栗子,假设在一个学校里面男生的概率和女生的概率分别是60%和40%,男生总是穿长裤,女生则一半穿长裤一半穿裙子。   正向概率:随机选取一个学生,他(她)穿长裤的概率和穿裙子的概率是多大?这个比例的计算就比较简单了。   逆向概率:迎面走来一个穿长裤的学生,你只看得见他(她)穿的是否长裤,而无法确定他(她)的性别,你能够推断出他(她)是女生的概率是多大吗?这就是我们要解决的问题。       假设学校里面人的总数是 U 个

Learn English With Movies | Will Smith

北城余情 提交于 2020-02-27 23:58:54
drop (someone/something) off - to leave someone/something at the destination to which one has transported it (捎带) ============================== Acquaintance - 相识 ============================== sit-down 坐下来谈谈,引申为见面或讨论某事 ~ we had a sit-down with the new employees and discussed the terms of contract ============================== come up (with something) 想某些事情,比如一个办法、答案、计划等等 ~ we need to come up with a good plan ============================== Earnestness 认真,诚挚 diligence 勤奋 team playing/teamwork 团队合作 ============================== arrest 逮捕 ============================== failure to (noun) ~ I was

--version support in a Python program built with Pants

邮差的信 提交于 2019-12-13 22:02:56
问题 How can I get Pants to store the output of git describe somewhere in my .pex file so that I can access it from the Python code I'm writing? Basically I want to be able to clone my project and do this: ./pants binary px Distribute the resulting dist/px.pex to somebody That somebody should be able to do px.pex --version and get a printout of whatever git describe said when I built the .pex in step one. Help! 回答1: Turns out pex already does git describe on build. The result it stores in a PEX

Pants includes OS X specific Python wheels

坚强是说给别人听的谎言 提交于 2019-12-03 14:52:47
问题 TLDR : Pants fetches OS X specific wheels bc I'm developing on Mac. How can I avoid this, or specify that I will deploy to Ubuntu? Full story : Trying to package a Python application with Pants. Going great so far, but ran into a problem which I've been stuck at for a while. I'm developing on a macbook but deploying to EC2 Ubuntu. Here's what I've done so far: Created virtualenv. Added BUILD files to applications, with the suggested 3rd party pattern for third party packages. Ran ./pants run

Pants includes OS X specific Python wheels

早过忘川 提交于 2019-12-03 03:46:52
TLDR : Pants fetches OS X specific wheels bc I'm developing on Mac. How can I avoid this, or specify that I will deploy to Ubuntu? Full story : Trying to package a Python application with Pants. Going great so far, but ran into a problem which I've been stuck at for a while. I'm developing on a macbook but deploying to EC2 Ubuntu. Here's what I've done so far: Created virtualenv. Added BUILD files to applications, with the suggested 3rd party pattern for third party packages. Ran ./pants run.py backend:admin_server which runs fine and generated dist/admin_server.pex Scp that .pex onto a fresh