data and dream
1 用通俗的语言介绍下线性回归->逻辑回归->SVM之间的区别和联系。
2 聚类算法的应用场景,以及k-means中的k值怎么确定。
def center(data): center = []
for num in data:
sumX = 0; sumY = 0
for j in num:
sumX += j[0]
sumY += j[1]
x = float(sumX) / len(data)
y = float(sumY) / len(data)
center.append([x, y]) return center def distance(one, two): sumT = 0
for i in range(len(one)):
sumT += pow((one[i] - two[i]), 2) return pow(sumT, 0.5) def update(data, kcenter): length = len(kcenter)
ret = [0] * length
for i in range(length):
ret[i] = [] for num in data:
tmp = []
for point in kcenter:
tmp.append(distance(num, point))
ret[tmp.index(min(tmp))].append(num) return ret if __name__ == '__main__': data = [(1, 2), (2, 3), (1, 6), (8, 9)]
kcenter = [[0.2, 1.2], [2, 3]]
error = 0.0000001 while True:
rt = update(data, kcenter)
tmp = center(rt)
sume = 0
for sa in range(len(kcenter)):
sume += distance(tmp[sa], kcenter[sa])
if sume < error:
print rt
break
else:
kcenter = tmp
Kmeans
3 协同过滤中评分矩阵中的元素怎么确定。大矩阵怎么分解。
4 文本挖掘怎么处理。
data and dream的更多相关文章
- Django——Ajax相关
Ajax简介 AJAX(Asynchronous Javascript And XML)翻译成中文就是“异步Javascript和XML”.即使用Javascript语言与服务器进行异步交互,传输的数 ...
- 【Repost】A Practical Intro to Data Science
Are you a interested in taking a course with us? Learn about our programs or contact us at hello@zip ...
- UVA - 10057 A mid-summer night's dream.
偶数时,中位数之间的数都是能够的(包含中位数) 奇数时,一定是中位数 推导请找初中老师 #include<iostream> #include<cstdio> #include ...
- Dream team: Stacking for combining classifiers梦之队:组合分类器
sklearn实战-乳腺癌细胞数据挖掘(博主亲自录制视频) https://study.163.com/course/introduction.htm?courseId=1005269003& ...
- 每日英语:The Risks of Big Data for Companies
Big data. It's the latest IT buzzword, and it isn't hard to see why. The ability to parse more infor ...
- [Poj2411]Mondriaan's Dream(状压dp)(插头dp)
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 18096 Accepted: 103 ...
- How Google Backs Up The Internet Along With Exabytes Of Other Data
出处:http://highscalability.com/blog/2014/2/3/how-google-backs-up-the-internet-along-with-exabytes-of- ...
- POJ1185 炮兵阵地 和 POJ2411 Mondriaan's Dream
炮兵阵地 Language:Default 炮兵阵地 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 34008 Accepted ...
- Dream权限追踪系统<=2.0.1 重安装漏洞
在./install/install.php中 if(file_exists('lock.txt')){ echo '系统已安装,请不要重复安装!如需安装,请删除install文件夹下的lock.tx ...
随机推荐
- linux中nc详解
|是管道符号,表示左边的输出作为右边的输入. 1.TCP端口扫描 # nc -v -z -w2 127.0.0.1 1-100 Connection to 127.0.0.1 22 port [tcp ...
- 自动完成--autoComplete插件
js下载地址:https://github.com/devbridge/jQuery-Autocomplete 1.引入js,引入css --start------------------------ ...
- jquery插件-表单验证插件-提示信息中文化与定制提示信息
接上一篇 2)messages 提示:修改默认的提示信息最简单的方法是引入message_zh.js文件即可! 如果需要在validate()方法内提示则可以使用本选项 类型:Object 说明:自定 ...
- 【poj3084】 Panic Room
http://poj.org/problem?id=3084 (题目链接) 题意 一个房子里面有m个房间,一些房间之间有门相连,而门的开关只在一个房间有,也就是说只有一个房间可以控制该扇门的开关.现在 ...
- 【poj3764】 The xor-longest Path
http://poj.org/problem?id=3764 (题目链接) 今天的考试题,看到异或就有点虚,根本没往正解上想.. 题意 给出一棵带权树,请找出树上的一条路径,使其边上权值的异或和最大. ...
- ListView优化-通用CommonAdapter编写备份
[ps:CommonAdapter基于ViewHolder工具类] CommonAdapter.java package cn.edu.bzu.util; import android.content ...
- sstream使用简介
sstream即字符串流.sstream有三种类:ostringstream:用于输出操作,istringstream:用于输入操作,stringstream:用于输入输出操作其实我感觉只用第三个就够 ...
- Adding New Functions to MySQL(User-Defined Function Interface UDF、Native Function)
catalog . How to Add New Functions to MySQL . Features of the User-Defined Function Interface . User ...
- zoj 3946 Highway Project(最短路 + 优先队列)
Highway Project Time Limit: 2 Seconds Memory Limit: 65536 KB Edward, the emperor of the Marjar ...
- JavaWeb---总结(十七)JSP中的九个内置对象
一.JSP运行原理 每个JSP 页面在第一次被访问时,WEB容器都会把请求交给JSP引擎(即一个Java程序)去处理.JSP引擎先将JSP翻译成一个_jspServlet(实质上也是一个servlet ...