摘要: list是双向链表,map保存key对应到list中的迭代器的位置,list保存<key,value> 阅读全文
posted @ 2016-07-03 15:47 simple_wxl 阅读(264) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<vector>#include<queue>#include<string>#include<map>using namespace std;struct node{ int val; node * left,*right; node(int _ 阅读全文
posted @ 2016-07-02 23:13 simple_wxl 阅读(146) 评论(0) 推荐(0) 编辑
摘要: int getposition(int arr[],int left,int right) { int tmp=arr[left]; while(left<right) { while(left<right&&arr[right]>=tmp) right--; arr[left]=arr[right 阅读全文
posted @ 2016-07-02 17:04 simple_wxl 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<stack>#include<vector>using namespace std;struct node{ int val; node *left,*right; node(int _val):val(_val),left(NULL),righ 阅读全文
posted @ 2016-06-30 15:29 simple_wxl 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-06-30 13:18 simple_wxl 阅读(963) 评论(0) 推荐(0) 编辑
摘要: EM算法的推导 阅读全文
posted @ 2016-06-29 21:30 simple_wxl 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 利用学习曲线判断是否过拟合和欠拟合 过拟合和欠拟合的处理: 其实不全啊,不想补了 过拟合原因: 1、数据N太小 2、噪声数据 3、模型过于复杂 过拟合:1)找更多的数据来学习,2)增大正则化系数 3)减少特征的个数(不太推荐) 欠拟合:1)找更多的特征 2)减少正则化系数 阅读全文
posted @ 2016-06-29 20:07 simple_wxl 阅读(190) 评论(0) 推荐(0) 编辑
摘要: L1正则化和L2正则化的区别:L1起截断作用,L2起缩放作用(不让参数θ过大) L1稀疏,L2平滑作用 L1的稀疏化性质去掉无关特征,只留下相关特征 L2如果特征有些是共线性的,L1会扔掉这些特征,导致模型误差较大 数据和特征处理 数据清洗 正负样本不平衡的处理方法:上采样,下采样,修改损失函数 数 阅读全文
posted @ 2016-06-29 19:46 simple_wxl 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 损失函数是对数损失函数 对损失函数求导:和线性回归的求导结果一样: 离散化: 快 稀疏化 给线性模型带来一定的非线性 模型稳定 在一定程度上降低过拟合风险 阅读全文
posted @ 2016-06-29 19:00 simple_wxl 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 方法一:头插法 方法二:递归法 #include<iostream>using namespace std;#include<vector>#include<algorithm>#include<string>#include<string.h>#include<queue>#include<alg 阅读全文
posted @ 2016-06-29 15:20 simple_wxl 阅读(166) 评论(0) 推荐(0) 编辑