03 2013 档案
摘要:#include<iostream>#include<vector>#include<set>#include<cmath>using namespace std;int lChild(int i){ return 2*i;}int rChild(int i){ return 2*i + 1;}void swap(int &a, int &b){ int t = a; a = b; b = t;}//min-heapvoid sift_down(int a[], int n, int i){ int min = i; int l
阅读全文
摘要:#include<iostream>#include<vector>using namespace std;void combination(const char str[],int num,vector<char> &result);void combination(const char str[]){ if(str == NULL) return; int len = strlen(str); int i=0; vector<char> result; for(i=1; i<=len; i++) combination(str,
阅读全文
摘要:1. 应用场景:首先要明确的是,Logistic Regression是用来分类的;与stanford的公开课进行类比,在该课程中所举的例子是根据训练集中房屋的各种feature(area,location等)和价格来预测测试集中的房屋价格,那么利用Logistic Regression就是来预测一种值域为[0,1]的label,如房屋价格上涨的概率p。若p>=0.5,则将其归为上涨;若p<0.5则将其归为不上涨。 如你要根据数据来预测房价是否会上涨来决定是否现在买房,那么Logistic Regression很适合你的选择,因为你care的是房价是否会上涨,而不是具体某个楼盘的房
阅读全文
摘要:#include<iostream>#include<cstring>using namespace std;void swap(char &a, char &b){ char t = a; a = b; b = t;}void permutation(char ch[],int s, int e){ int i = 0; if(s > e) return; if(s == e) { for(i=0; i<=e; i++) cout<<ch[i]; cout<<endl; r...
阅读全文
摘要:#include<iostream>using namespace std;int parent(int i){ return i/2;}int left(int i){ return 2*i;}int right(int i){ return 2*i + 1;}void swap(int &a, int &b){ int t = a; a = b; b = t;}void max_heapify(int arr[],int size, int i){ int l = left(i); int r = right(i); int large...
阅读全文