Distribution Shapes 由直方图到 smooth curve 1.this distribution of heights is bell shaped(or mound shaped), but the smooth curve makes seeing the shape a little easier. 2.need not worry about minor differences in shape(全局),allows us to classify most dis…
最近一个月的时间,基本上都在加班加点的写业务,在写代码的时候,也遇到了一个有趣的问题,值得记录一下. 简单来说,需求是从一个字典(python dict)中随机选出K个满足条件的key.代码如下(python2.7): def choose_items(item_dict, K, filter): '''item_dict = {id:info} ''' candidate_ids = [id for id in item_dict if filter(item_dict[id])] if le…
CORRELATION COEFFICIENTS We've discussed how to summarize a single variable. The next question is how to summarize a pair of variables measured on the same observational unit--(percent of calories from saturated fat, cholesterol level), (amount of fe…
原文Draw a smooth curve through a set of 2D points with Cubic Spline I would like to provide you with the code to draw a smooth curve through a set of 2D points with cubic spline. If we have some tabulated function yi=f(xi) it's easy to get its cubic s…
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1116 1116: Kingdoms Time Limit: 3 Sec Memory Limit: 64 MBSubmit: 293 Solved: 82[Submit][Status][Web Board] Description A kingdom has n cities numbered 1 to n, and some bidirectional roads connecting…
-------------------------------------------------------------- Chapter 1: Introduction to Discrete Differential Geometry: The Geometry of Plane Curves . A better approximation than the tangent is the circle of curvature. . If the curve is sufficientl…
Introduction to Random forest(Simplified) With increase in computational power, we can now choose algorithms which perform very intensive calculations. One such algorithm is “Random Forest”, which we will discuss in this article. While the algorithm…
最近在给公司培训Python,布置了一道题: ------------------------------------------------------------------------------------------- Generate 10 random floats(value range is (-2.0,2.0) and precision is 1) and save as list; Such as: [-0.7, 0.8, 1.6, 0.1, 0.3, -1.0, 0.4…
radom radom模块提供了随机生成对象的方法 Help on module random: NAME random - Random variable generators. FILE /usr/local/lib/python2.7/random.py MODULE DOCS http://docs.python.org/library/random DESCRIPTION integers -------- uniform within range sequences --------…