12 2018 档案
摘要:1 #include 2 using namespace std; 3 4 typedef struct node 5 { 6 char data; 7 struct node *lchild; 8 struct node *rchild; 9 }BiTreeNode,*BiTree; 10 11 void createBiTree(BiTree ...
阅读全文
摘要:#include #include const int N=10005; using namespace std; struct edge { int u,v,w; bool operator w >n&&n){ m=n*(n-1)/2; for(int i=0;i>e[i].u>>e[i].v>>e[i].w; cout #i...
阅读全文
摘要:1 #include 2 using namespace std; 3 #define MAX_N 1000 4 int par[MAX_N]; 5 int ranks[MAX_N]; 6 7 //初始化n个元素 8 void init(int n) 9 { 10 for(int i=0;i<n;i++){ 11 par[i]=i; 12 ...
阅读全文
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <queue> 4 #include <set> 5 using namespace std; 6 int main() 7 { 8 //声明 9 set<int> s; 10 11 //插入元
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 map mp; 8 map ::iterator it; 9 mp.insert({'a',1}); 10 mp.insert({'b',2}); 11 mp.insert({'c',...
阅读全文
摘要:调用priority_queue<int> pq; 默认为最大堆 调用下面的可以指定最大堆或者最小堆 priority_queue<int,vector<int>,less<int> > p; priority_queue<int,vector<int>,greater<int> > q;
阅读全文
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <queue> 4 using namespace std; 5 int main() 6 { 7 queue<int> q; 8 q.push(1);//1 9 q.push(2);//1,2
阅读全文
摘要:1 #include <cstdio> 2 #include <stack> 3 using namespace std; 4 int main() 5 { 6 stack<int> s; 7 s.push(1);//1 8 s.push(2);//1,2 9 s.push(3);//1,2,3 1
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define N 1005 8 int dp[N+1][N+1]; 9 int b[N+1][N+1]; 10 char str1[N],str2[N]; 11 void lcs(int len1,int l...
阅读全文
摘要:1 #include <iostream> 2 using namespace std; 3 void Qsort(int a[],int l,int r) 4 { 5 if(l>=r) return ; 6 int ll=l,rr=r,key=a[ll]; 7 while(ll<rr){ 8 wh
阅读全文
摘要:#include <iostream> using namespace std; int binSearch(int a[],int b,int n) { int l=0,r=n-1,mid=0; while(l<=r){ mid=(l+r)>>1; if(a[mid]==b) return mid
阅读全文
摘要:要求: 1. 参考教材实例20,编写Python爬虫程序,获取江西省所有高校的大学排名数据记录,并打印输出。 2. 使用numpy和matplotlib等库分析数据,并绘制南昌大学、华东交通大学、江西理工大学三个高校的总分排名、生源质量(新生高考成绩得分)、培养结果(毕业生就业率)、顶尖成果(高被引
阅读全文
摘要:数据集来源:https://www.kaggle.com/psparks/instacart-market-basket-analysis 思路: 实例代码: 运行结果: 从结果中可以看出数据的维数降到了27
阅读全文
摘要:数据集的结构:特征值+目标值 (有些可以没有目标值) 数据集:uci kaggle 数据处理工具:pandas sklearn 缺失值 重复值 不需要处理 转换器是一类实现了特征工程的API: 估计器是一类实现了算法的API: 测试代码: 运行结果:
阅读全文
摘要:监督学习:特征值+目标值非监督学习:特征值 分类:目标值为离散型回归:目标值为连续型 开发流程:类似于数学建模的过程
阅读全文
摘要:数据降维维度:即特征的数量 数据降维的方法有:1.特征选择 2.主成分分析 特征选择: 代码实例: 运行结果: 主成分分析PCA: 代码实例: 运行结果:
阅读全文
摘要:特征的预处理:对数据进行处理 特征处理:通过特定的统计方法(数学方法)将数据转换成算法要求的数据 归一化: 多个特征同等重要的时候需要进行归一化处理目的:使得某一个特征对最终结果不会造成更大影响 归一化API: 标准化: 归一化及标准化实例代码: 运行结果:
阅读全文
摘要:文本分类tf:词的频率 idf:逆文档频率 代码实例: 运行结果:
阅读全文