- 博客(96)
- 收藏
- 关注
转载 监督学习与无监督学习
机器学习的基本理论:转载自http://blog.youkuaiyun.com/jwh_bupt/article/details/7654120
2014-07-17 16:13:00
1005
转载 GMM(高斯混合模型)
聚类的方法有很多种,k-means要数最简单的一种聚类方法了,其大致思想就是把数据分为多个堆,每个堆就是一类。每个堆都有一个聚类中心(学习的结果就是获得这k个聚类中心),这个中心就是这个类中所有数据的均值,而这个堆中所有的点到该类的聚类中心都小于到其他类的聚类中心(分类的过程就是将未知数据对这k个聚类中心进行比较的过程,离谁近就是谁)。其实k-means算的上最直观、最方便理解的一种聚类方式了,原
2014-07-01 10:04:33
1268
原创 C++ Primer文本查询程序(TextQuery)功能加强版
详见书的15.9节。 面向对象的实现。一些需要 注意的 地方:1.#pragma once,在 TextQuery.h文件 中添加,确保其只被编译一次,避免redefinition错误一些 细节,参照了这位大神的 代码http://blog.youkuaiyun.com/hustspy1990/article/details/7296485先贴 代码,运行起来 似乎 还有些 问题 ,可
2014-07-01 09:53:28
951
原创 C++ Primer文本查询程序(TextQuery)的实现(2014.5.24)
详见书的10.6节。 按行查找文件,并且按照顺序进行显示,同时对单词出现的次数进行统计。同一行出现多次,只按照一次进行计算。1.头文件#include #include #include #include #include #include #include #include using namespace std;2.TextQuery类的
2014-07-01 09:52:36
816
原创 python处理用户签到数据(一)(2014.5.14)
读文件 的操作:f=open("checkin\\data_test.csv",'r') newline=f1.readline() if newline='': break;
2014-05-21 12:49:17
2556
原创 matlab读取csv文件存在字符串的问题(2014.5.8)
http://blog.youkuaiyun.com/bendanban/article/details/16335359这个链接基本上可以解决所遇到的问题,我要读取的是LBSN中签到记录的敬畏度数,但是就是读取不了,尝试了下用这个链接的最后的语句是可以读取字符和数字混合的记录的,当是我的记录有特殊性5259ba9911d2b343baafd9a7,134398,13/10/2013 05:09
2014-05-21 12:47:53
6492
原创 matlab读取csv文件存在字符串的问题(2014.5.8)
http://blog.youkuaiyun.com/bendanban/article/details/16335359这个链接基本上可以解决所遇到的问题,我要读取的是LBSN中签到记录的敬畏度数,但是就是读取不了,尝试了下用这个链接的最后的语句是可以读取字符和数字混合的记录的,当是我的记录有特殊性5259ba9911d2b343baafd9a7,134398,13/10/2013 05:09
2014-05-09 12:02:45
12750
原创 leetcode-Convert Sorted Array to Binary Search Tree(2014.4.20)
Convert Sorted Array to Binary Search Tree Total Accepted: 10637 Total Submissions: 33426My SubmissionsGiven an array where elements are sorted in ascending order, convert it to a height balan
2014-04-20 21:08:45
664
原创 剑指offer-题目1388:跳台阶 (2014.1.5)
//采用递归的方案,类似于递归中的子集问题,超时#include #include #include using namespace std;void jumpStep(int soFar,int n,int &iCount){ if (soFar==n) { iCount++; return; }else
2014-04-20 19:39:38
514
原创 Activity Duration Analysis for Context-aware Services(2013.10.27)
1.[ABSTRACT]发现计算活动时间的模式,活动的延续时间对推荐系统的及时推荐有很大作用(不太明白活动的延续时间对及时推荐的作用)。本文给出了初始的推荐结果和评价及其将来的计划。2.可能延续时间的作用似乎可用距离说明:在用户还处于商场中 的时候向其推销该商场的优惠券(这当和预测性推销是 不相同的一种预测模式,是否可以理解为一种是时间上的实时,一种是位置上的实时)。3。GPS 等设备记载
2014-04-20 19:38:31
623
原创 Context-Aware Community:Integrating Contexts。。。。(2013.9.27)
1.社区结构受到移动性的影响(移动社交网络),实则LBSN的网络即是基于移动性的。2.本文中的基于proximity-based(基于附近)的移动社交网络,当和LBSN 有相近的含义。3.现有工作,簇的划分往往基于联系,通信时间和通信时长(相近位置)。似乎据杨婧的论文,DTN中的局部社区也是以此两个参量衡量的,忽略的是通信发生的时间和位置。缺陷在于难以发挥分享的作用,即基于内容的作用?本文
2014-04-20 19:37:31
636
原创 Find me if you can:improving geographical...(2013.9.27)
1。关于位置预测 ,数据FACEBOOK,地理位置和好友关系之间的联系2。位置预测的作用1)提供更好的服务(如本地内容),2)安全,如QQ异地登陆提示 3)给出用户联系人位置,计算出该用户的家庭位置。3。若是好友聚集一处,预测想必是简单的,若是好友比较分散,则预测的难度会变大吧。4。以权重的预测是存在问题的,尤其显示在位于海岸线的用户上。5。。好友关系和距离成幂律分
2014-04-20 19:36:48
576
原创 Friendship and Mobility :User Movement In Location-Based Social Networks(2013.10.10)
1.[ABSTRACT ]目标是发现左右人类移动、运动的基本法则。人类的运动由周期性受地理位置限制的运动及一些随机的运动组成。其中的短途的旅行在时间和空间上都是周期性的且不受地理位置的影响,长途的旅行往往受限于社交关系。据此建立人类运动的模型2。一些想法:短途数据的是否是依据LBSN中的签到来判断?长途是否先要判定出其家乡或者长期居住地,然后通过距离计算判断其是长途旅行?想来长途和短途都必须依
2014-04-20 19:35:52
1210
原创 leetcode-Binary Tree Inorder Traversal(2014.1.23)
递归方法:/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };
2014-04-20 19:35:41
461
原创 LBSN 预测的想法(2013.11.11)
1.预测并不是对未来做工作,本质上来讲是对过去的分析。对过去的东西进行数据挖据和分析工作2.现在存在的问题,A.时间框架的选取。B.模型的选取,即是影响因素的确定。3.与董羿讨论,没必要全套LDA 的模型,一部分通过其处理即可以。4.用户的筛选问题。5.想法:当和时间维度有极大的关系。我所指的时间维度是指用户行为在时间上的重复性。6.是否可以将用户时间框架进行区分。根据时间状态
2014-04-19 23:20:07
757
原创 Linked List Cycle(2014.2.7)
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: bool hasCycle(
2014-04-19 23:19:21
539
原创 Linked List Cycle II(2014.2.7)
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *dete
2014-04-19 23:18:43
565
原创 Location-based Predictions for Personalized Contextual...(2013.10.29)
1.[INTRODUCTION ]提前的预测,指的是诸如预测到用户会在今后的某一天出差而向其 推销飞机票。 本文解决的两个工作:1。预测将来某事的发生2。触发推荐动作(如达到某一临界值即触发)2.[Methodolgy]时间和地点的种类信息并不足以精确地做出细粒度的估计,尤其对于新用户更加困难。活动历史记录的稀疏性是显而易见的。 A.采用忽略具体时间而只是预测地点类型的方法
2014-04-19 23:18:04
693
原创 Single Number(2014.2.7)
class Solution {public: int singleNumber(int A[], int n) { int x=A[0]; for(int i=1;i x^=A[i]; } return x; }};
2014-04-19 23:17:16
521
原创 Spiral Matrix II(2014.3.2)
想来是有递归解法的,对递归的体会尚且不够。class Solution {public: vector > generateMatrix(int n) { vector> vec; if(n==0) return vec; vector vec1; for(int i=0;i vec1.pus
2014-04-19 23:16:28
574
原创 Travel Toute Recommendation Using Geotags inPhoto Sharing Sites(2013.10.14)
1。ABSTRACT 采用Flicker 的数据集合,采用马尔科夫方法进行预测,Flicker 的数据和LBSN的数据有相似性,采用轨迹预测。不同之处是其参考条件除了当前状态之外还有用户的喜好。2。INTRODUCTION 其认为传照片是对该地址表达了一种喜爱,从而该地址可以作为被推荐的对象。Fpursquare这种社交网络似乎不能如此 判定(核实下有无喜爱这种选项)。该文的贡献主要是提出
2014-04-19 23:15:47
687
原创 leetcode OJ -Binary Tree Postorder Traversal(2014.1.20)
递归方法:/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };
2014-04-19 23:14:24
619
原创 leetcode OJ -Binary Tree Preorder Traversal(2014.1.20)
递归:/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };
2014-04-19 23:13:45
526
原创 leetcode-3Sum (2014.4.7)
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c) must b
2014-04-19 23:12:58
545
原创 leetcode-3Sum Closest (2014.4.10)
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly
2014-04-19 23:12:19
518
原创 leetcode-Add Binary(2014.3.3)
字符串的相关操作class Solution {public: string addBinary(string a, string b) { int na=a.size(); int nb=b.size(); int overflow=0; string sum(na>nb?na:nb,'0');
2014-04-19 23:11:39
550
原创 leetcode-Add Two Numbers (2014.2.27)
细节很多,用了相当长的时间。代码长度很长,不够简洁。/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */cla
2014-04-19 23:10:45
520
原创 leetcode-Generate Parentheses (2014.4.18)
Generate Parentheses Total Accepted: 10265 Total Submissions: 33530 My SubmissionsGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example
2014-04-19 23:08:59
525
原创 leetcode-Balanced Binary Tree(2014.1.27)
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */cla
2014-04-19 23:08:11
502
原创 leetcode-Best Time to Buy and Sell Stock(2014.2.17)
O(n)时间即可以完成class Solution {public: int maxProfit(vector &prices) { if(prices.size() int maxPro=0; int low=prices[0]; for(int i=0;i int m=price
2014-04-19 23:07:28
445
原创 leetcode-Best Time to Buy and Sell Stock(2014.2.16)
用两层遍历的方法超时:class Solution {public: int maxProfit(vector &prices) { int maxPro=0; for(int i=0;i for(int j=i+1;j int m=prices[j]-prices[i];
2014-04-19 23:06:46
549
原创 leetcode-Best Time to Buy and Sell Stock II(2014.2.17)
即是求整个波浪线的上升过程,解法略显繁琐,当可以直接采用判断,若数组中元素后一个比前一个大,则不断累加的方法。class Solution {public: int maxProfit(vector &prices) { int low; int high; int maxPro=0; int flag=1;
2014-04-19 23:05:57
573
原创 leetcode-Best Time to Buy and Sell Stock III(2014.2.17)
整个调试过程花了好久,还是在参考别人答案的情况下。好吧,牙疼,昨夜没怎么睡觉,状态不佳。 采用动态规划的方法,时间复杂度为O(n)就搞定了,动态规划的核心似乎是备忘录。不过和诗辉讨论认为这个似乎并不是动态规划。class Solution {public: int maxProfit(vector &prices) { if(prices.
2014-04-19 23:05:08
613
原创 leetcode-Binary Tree Inorder Traversal(2014.1.23)
递归方法:/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * };
2014-04-19 23:04:26
509
原创 编程之美初赛-焦距(2014.4.19)
时间限制:2000ms单点时限:1000ms内存限制:256MB描述一般来说,我们采用针孔相机模型,也就是认为它用到的是小孔成像原理。在相机坐标系下,一般来说,我们用到的单位长度,不是“米”这样的国际单位,而是相邻像素的长度。而焦距在相机坐标系中的大小,是在图像处理领域的一个非常重要的物理量。假设我们已经根据相机参数,得到镜头的物理焦距大小(focal length
2014-04-19 16:14:37
702
原创 leetcode-Binary Tree Level Order Traversal(2014.1.22)
//记载每一行有多少个节点,采用队列结构/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NUL
2014-04-15 20:07:05
499
原创 leetcode-Binary Tree Level Order Traversal II(2014.1.27)
此题可以递归?二叉树是递归结构,层次遍历则好像不是/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), righ
2014-04-15 20:06:32
613
原创 leetcode-Candy(2014.2.25)
class Solution {public: int candy(vector &ratings) { if(ratings.size()==0) return 0; if(ratings.size()==1) return 1; vector candy(ratings.size()); int m=0;
2014-04-15 20:05:47
468
原创 leetcode-First Missing Positive(2014.2.25)
哈希的思想是能够在常数时间内进行查找,哈希函数是具体的实现方法,应当各有不同。class Solution {public: int firstMissingPositive(int A[], int n) { if(n for(int i=0;i if(A[i] } for(i
2014-04-15 20:05:07
515
原创 leetcode-Jump Game(2014.2.23)
需要两个计数,lastJump记载当前能跳最远处,maxJump记录实际能跳最远距离。class Solution {public: bool canJump(int A[], int n) { int lastJump=0; int maxJump=0; int i=0; while(maxJump
2014-04-15 20:04:24
525
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人