博客园 - patty-pattyuuid:24b78886-0ed1-41c2-8670-e3f31dcf42c4;id=144802016-11-18T11:33:45Zpatty-pattyhttps://www.cnblogs.com/north-north/feed.cnblogs.comhttps://www.cnblogs.com/north-north/p/4360121.htmlkaggle数据挖掘竞赛初步--Titanic<随机森林&特征重要性> - patty-patty完整代码:https://github.com/cindycindyhi/kaggle-Titanic特征工程系列:Titanic系列之原始数据分析和数据处理Titanic系列之数据变换Titanic系列之派生属性&维归约之前的三篇博文已经进行了一次还算完整的特征工程,分析字符串类型的变量获取新变量...2015-03-23T08:13:00Z2015-03-23T08:13:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】完整代码:https://github.com/cindycindyhi/kaggle-Titanic特征工程系列:Titanic系列之原始数据分析和数据处理Titanic系列之数据变换Titanic系列之派生属性&维归约之前的三篇博文已经进行了一次还算完整的特征工程,分析字符串类型的变量获取新变量... <a href="https://www.cnblogs.com/north-north/p/4360121.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/4358084.htmlkaggle数据挖掘竞赛初步--Titanic<派生属性&维归约> - patty-patty完整代码:https://github.com/cindycindyhi/kaggle-Titanic特征工程系列:Titanic系列之原始数据分析和数据处理Titanic系列之数据变换Titanic系列之派生属性&维归约为什么有的机器学习项目成功了有的却失败了呢?毕竟算法是有限的改进也是有限的,最...2015-03-22T13:34:00Z2015-03-22T13:34:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】完整代码:https://github.com/cindycindyhi/kaggle-Titanic特征工程系列:Titanic系列之原始数据分析和数据处理Titanic系列之数据变换Titanic系列之派生属性&维归约为什么有的机器学习项目成功了有的却失败了呢?毕竟算法是有限的改进也是有限的,最... <a href="https://www.cnblogs.com/north-north/p/4358084.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/4354775.htmlkaggle数据挖掘竞赛初步--Titanic<数据变换> - patty-patty完整代码:https://github.com/cindycindyhi/kaggle-Titanic特征工程系列:Titanic系列之原始数据分析和数据处理Titanic系列之数据变换Titanic系列之派生属性&维归约缺失值填充之后,就要对其他格式有问题的属性进行处理了。比如Sex Embark...2015-03-20T14:27:00Z2015-03-20T14:27:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】完整代码:https://github.com/cindycindyhi/kaggle-Titanic特征工程系列:Titanic系列之原始数据分析和数据处理Titanic系列之数据变换Titanic系列之派生属性&维归约缺失值填充之后,就要对其他格式有问题的属性进行处理了。比如Sex Embark... <a href="https://www.cnblogs.com/north-north/p/4354775.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/4353365.htmlkaggle数据挖掘竞赛初步--Titanic<原始数据分析&缺失值处理> - patty-pattyTitanic是kaggle上的一道just for fun的题,没有奖金,但是数据整洁,拿来练手最好不过啦。这道题给的数据是泰坦尼克号上的乘客的信息,预测乘客是否幸存。这是个二元分类的机器学习问题,但是由于数据样本相对较少,在当时慌乱的情况下幸存者有一定的随机性,还是有一定挑战的。https://...2015-03-20T05:00:00Z2015-03-20T05:00:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】Titanic是kaggle上的一道just for fun的题,没有奖金,但是数据整洁,拿来练手最好不过啦。这道题给的数据是泰坦尼克号上的乘客的信息,预测乘客是否幸存。这是个二元分类的机器学习问题,但是由于数据样本相对较少,在当时慌乱的情况下幸存者有一定的随机性,还是有一定挑战的。https://... <a href="https://www.cnblogs.com/north-north/p/4353365.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/4316656.html<python 深入理解>变量交换x,y=y,x实现机制--元组 - patty-pattypython中有一种赋值机制即多元赋值,采用这种方式赋值时,等号两边的对象都是元组并且元组的小括号是可选的。通常形式为x, y, z = 1, 2, 'a string'等同于(x, y, z) = (1, 2,'a string')这种赋值类型最经常用到的环境是变量交换,形如x, y = y, x...2015-03-05T12:16:00Z2015-03-05T12:16:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】python中有一种赋值机制即多元赋值,采用这种方式赋值时,等号两边的对象都是元组并且元组的小括号是可选的。通常形式为x, y, z = 1, 2, 'a string'等同于(x, y, z) = (1, 2,'a string')这种赋值类型最经常用到的环境是变量交换,形如x, y = y, x... <a href="https://www.cnblogs.com/north-north/p/4316656.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3770520.htmljava基本输入输出练习 - patty-pattyjava获取用户的输入分两种,一种是字符的输入,一种是整行的输入,要用到java.io包。对于字符输入来说,使用System.in方法可以输入字符;对于整行的输入,可以使用Scanner类的方法获取整行输入。import java.io.*;import java.util.*;public cl...2014-06-05T08:02:00Z2014-06-05T08:02:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】java获取用户的输入分两种,一种是字符的输入,一种是整行的输入,要用到java.io包。对于字符输入来说,使用System.in方法可以输入字符;对于整行的输入,可以使用Scanner类的方法获取整行输入。import java.io.*;import java.util.*;public cl... <a href="https://www.cnblogs.com/north-north/p/3770520.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248996.htmlI:trainage Ditches - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Farmer John has built a set of drainage ditches so that Bessie納-08-09T12:31:00Z2013-08-09T12:31:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Farmer John has built a set of drainage ditches so that Bessie <a href="https://www.cnblogs.com/north-north/p/3248996.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248990.htmlH:Highways - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They're planning to build some highways so that it will be possible to drive b2013-08-09T12:25:00Z2013-08-09T12:25:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They're planning to build some highways so that it will be possible to drive b <a href="https://www.cnblogs.com/north-north/p/3248990.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248987.htmlG:数字三角形 - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述73 88 1 02 7 4 44 5 2 6 5(图1)图1给出了一个数字三角形。从三角形的顶部到底部有很多条不同的路径。对于每条路径,把路径上面的数加起来可以得到一个和,你的任务就是找到最大的和。注意:路径上的每一步只能从一个数走到下一层上和它最近的左边的那个数或者右边的那个数。输入输入的是一行是一个整数N (1 #include using namespace std;int main(){ int bf[105][105]; int i,j; int n; cin>>n; for(i=0;i>bf[...2013-08-09T12:24:00Z2013-08-09T12:24:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述73 88 1 02 7 4 44 5 2 6 5(图1)图1给出了一个数字三角形。从三角形的顶部到底部有很多条不同的路径。对于每条路径,把路径上面的数加起来可以得到一个和,你的任务就是找到最大的和。注意:路径上的每一步只能从一个数走到下一层上和它最近的左边的那个数或者右边的那个数。输入输入的是一行是一个整数N (1 #include using namespace std;int main(){ int bf[105][105]; int i,j; int n; cin>>n; for(i=0;i>bf[... <a href="https://www.cnblogs.com/north-north/p/3248987.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248986.htmlF:ungeon Master - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonally and the maze is su2013-08-09T12:22:00Z2013-08-09T12:22:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonally and the maze is su <a href="https://www.cnblogs.com/north-north/p/3248986.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248983.htmlE:Sudoku - patty-patty总时间限制: 2000ms 内存限制: 65536kB描述Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the empty cells with decimal dig2013-08-09T12:20:00Z2013-08-09T12:20:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 2000ms 内存限制: 65536kB描述Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the empty cells with decimal dig <a href="https://www.cnblogs.com/north-north/p/3248983.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248979.htmlD:Balanced Lineup - patty-patty总时间限制: 5000ms 内存限制: 65536kB描述For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the milking li2013-08-09T12:18:00Z2013-08-09T12:18:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 5000ms 内存限制: 65536kB描述For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the milking li <a href="https://www.cnblogs.com/north-north/p/3248979.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248974.htmlC:上台阶 - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述楼梯有n(100 > n > 0)阶台阶,上楼时可以一步上1阶,也可以一步上2阶,也可以一步上3阶,编程计算共有多少种不同的走法。输入输入的每一行包括一组测试数据,即为台阶数n。最后一行为0,表示测试结束。输出每一行输出对应一行输入的结果,即为走法的数目。样例输入12340样例输出1247解析:类似于斐波那契数列的递归做法。关键在于找到其递归规则。 如果是1阶楼梯,共有1种走法。 如果是两阶楼梯,共有 1 1、2两种走法。 如果是3阶楼梯,共有111、12、21、3这4种走法。 如果是4阶楼梯,可以从1阶直接上到4阶或者从22013-08-09T12:15:00Z2013-08-09T12:15:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述楼梯有n(100 > n > 0)阶台阶,上楼时可以一步上1阶,也可以一步上2阶,也可以一步上3阶,编程计算共有多少种不同的走法。输入输入的每一行包括一组测试数据,即为台阶数n。最后一行为0,表示测试结束。输出每一行输出对应一行输入的结果,即为走法的数目。样例输入12340样例输出1247解析:类似于斐波那契数列的递归做法。关键在于找到其递归规则。 如果是1阶楼梯,共有1种走法。 如果是两阶楼梯,共有 1 1、2两种走法。 如果是3阶楼梯,共有111、12、21、3这4种走法。 如果是4阶楼梯,可以从1阶直接上到4阶或者从2 <a href="https://www.cnblogs.com/north-north/p/3248974.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248973.htmlB:冷血格斗场 - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述为了迎接08年的奥运会,让大家更加了解各种格斗运动,facer新开了一家冷血格斗场。格斗场实行会员制,但是新来的会员不需要交入会费,而只要同一名老会员打一场表演赛,证明自己的实力。我们假设格斗的实力可以用一个正整数表示,成为实力值,两人的实力值可以相同。另外,每个人都有一个唯一的id,也是一个正整数。为了使得比赛更好看,每一个新队员都会选择与他实力最为接近的人比赛,即比赛双方的实力值之差的绝对值越小越好,如果有多个人的实力值与他差别相同,则他会选择id最小的那个。不幸的是,Facer一不小心把比赛记录弄丢了,但是他还保留着会员的注册记录2013-08-09T12:14:00Z2013-08-09T12:14:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述为了迎接08年的奥运会,让大家更加了解各种格斗运动,facer新开了一家冷血格斗场。格斗场实行会员制,但是新来的会员不需要交入会费,而只要同一名老会员打一场表演赛,证明自己的实力。我们假设格斗的实力可以用一个正整数表示,成为实力值,两人的实力值可以相同。另外,每个人都有一个唯一的id,也是一个正整数。为了使得比赛更好看,每一个新队员都会选择与他实力最为接近的人比赛,即比赛双方的实力值之差的绝对值越小越好,如果有多个人的实力值与他差别相同,则他会选择id最小的那个。不幸的是,Facer一不小心把比赛记录弄丢了,但是他还保留着会员的注册记录 <a href="https://www.cnblogs.com/north-north/p/3248973.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3248968.htmlA:石头剪刀布 - patty-patty总时间限制: 1000ms 内存限制: 65536kB描述石头剪刀布是常见的猜拳游戏。石头胜剪刀,剪刀胜布,布胜石头。如果两个人出拳一样,则不分胜负。一天,小A和小B正好在玩石头剪刀布。已知他们的出拳都是有规律的,比如:“石头-布-石头-剪刀-石头-布-石头-剪刀……”,就是以“石头-布-石头-剪刀”为周期的。请问,小A和小B比了N轮之后,谁赢了?输入输入的第一行包含一个整数K(0 #include using namespace std;bool win(int i,int j){ if(i==0 && j==2) return true; if(i==0 &&2013-08-09T12:13:00Z2013-08-09T12:13:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】总时间限制: 1000ms 内存限制: 65536kB描述石头剪刀布是常见的猜拳游戏。石头胜剪刀,剪刀胜布,布胜石头。如果两个人出拳一样,则不分胜负。一天,小A和小B正好在玩石头剪刀布。已知他们的出拳都是有规律的,比如:“石头-布-石头-剪刀-石头-布-石头-剪刀……”,就是以“石头-布-石头-剪刀”为周期的。请问,小A和小B比了N轮之后,谁赢了?输入输入的第一行包含一个整数K(0 #include using namespace std;bool win(int i,int j){ if(i==0 && j==2) return true; if(i==0 && <a href="https://www.cnblogs.com/north-north/p/3248968.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3246637.htmli++问题 - patty-patty例题,以下代码的输出结果是什么?#include int main(){ int arr[] = {6,7,8,9,10}; int *ptr = arr; *(ptr++) += 123; printf("%d,%d\n",*ptr,*(++ptr)); return 0;}解析: 首先明确C中的printf函数是从右到左压栈的。 *(ptr++) += 123; 等同于 *ptr =*ptr + 123; ptr++;(就算ptr++有括号也是要后算的)。此时ptr指向数组第二个元素7. printf("%d,%d\n",*ptr,*(++ptr))2013-08-08T12:58:00Z2013-08-08T12:58:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】例题,以下代码的输出结果是什么?#include int main(){ int arr[] = {6,7,8,9,10}; int *ptr = arr; *(ptr++) += 123; printf("%d,%d\n",*ptr,*(++ptr)); return 0;}解析: 首先明确C中的printf函数是从右到左压栈的。 *(ptr++) += 123; 等同于 *ptr =*ptr + 123; ptr++;(就算ptr++有括号也是要后算的)。此时ptr指向数组第二个元素7. printf("%d,%d\n",*ptr,*(++ptr)) <a href="https://www.cnblogs.com/north-north/p/3246637.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/p/3246597.html赋值语句 - patty-patty例题,求输出结果。 1 #include 2 using namespace std; 3 int func(int x) 4 { 5 int count=0; 6 while(x) 7 { 8 count++; 9 x = x & ( x-1 );10 11 }12 return count;13 }14 15 int main()16 {17 cout<<func(9999)<<endl;18 return 0;19 } 分析本题func函数可知其返回值是形参x转化为...2013-08-08T12:46:00Z2013-08-08T12:46:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】例题,求输出结果。 1 #include 2 using namespace std; 3 int func(int x) 4 { 5 int count=0; 6 while(x) 7 { 8 count++; 9 x = x & ( x-1 );10 11 }12 return count;13 }14 15 int main()16 {17 cout<<func(9999)<<endl;18 return 0;19 } 分析本题func函数可知其返回值是形参x转化为... <a href="https://www.cnblogs.com/north-north/p/3246597.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/archive/2013/04/03/2998573.html设计图 - patty-patty花了一下午做了个软件启动图,ps用的依然不顺手,勉强做出来。第一张自己还算比较满意的图,纪念一下。记得当年的梦想是做建筑设计师,上了三年的大学,现在的我已经忘了贝聿铭王澍赖特高迪之类了,谁拿普利兹克奖也已经和我没有任何关系了。可我还是疯狂的怀念那些年背过的拗口的建筑术语,偷看的中外建筑史,被翻得起了毛边的画册,被扔掉的一张张草纸。那是我高中三年的动力,后来,我是怎么放弃了我心心念念誓死不归的梦想的,已经记不起了。我甚至一直都没怎么想起过它。直到今天,突然想起来,原来我也是有艺术细菌的,我妈应该为我继承了她的一点点衣钵感到高兴了吧。 这么多年,我一直在走路,走着走着,路过的风景就路过了,喜...2013-04-03T11:16:00Z2013-04-03T11:16:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】花了一下午做了个软件启动图,ps用的依然不顺手,勉强做出来。第一张自己还算比较满意的图,纪念一下。记得当年的梦想是做建筑设计师,上了三年的大学,现在的我已经忘了贝聿铭王澍赖特高迪之类了,谁拿普利兹克奖也已经和我没有任何关系了。可我还是疯狂的怀念那些年背过的拗口的建筑术语,偷看的中外建筑史,被翻得起了毛边的画册,被扔掉的一张张草纸。那是我高中三年的动力,后来,我是怎么放弃了我心心念念誓死不归的梦想的,已经记不起了。我甚至一直都没怎么想起过它。直到今天,突然想起来,原来我也是有艺术细菌的,我妈应该为我继承了她的一点点衣钵感到高兴了吧。 这么多年,我一直在走路,走着走着,路过的风景就路过了,喜... <a href="https://www.cnblogs.com/north-north/archive/2013/04/03/2998573.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/archive/2013/04/01/2993724.htmlCUDA--图像拉伸(使用纹理内存texture) - patty-patty利用CUDA纹理内存完成图像拉伸。2013-04-01T08:21:00Z2013-04-01T08:21:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】利用CUDA纹理内存完成图像拉伸。 <a href="https://www.cnblogs.com/north-north/archive/2013/04/01/2993724.html" target="_blank">阅读全文</a>https://www.cnblogs.com/north-north/archive/2013/03/20/2971081.html在windows下编译d_nets遇到的各种问题汇总 - patty-patty在windows下编译d_nets费了我将近一周的课余时间。期间问题数不胜数,今天终于成功。 编译d_nets需要安装了opencv的vs,当然也可以自己cmake一下opencv。我是在vs2010上配置opencv各种参数。(1)opencv2.4.1 不支持SIFT 首先我安装的是opencv2.4.1版本,vs2010配置各种路径后,cv::SIFT::等一系列函数均不识别。刚开始接触opencv,最开始一直没找到报错的原因。百度了好久发现,opencv2.4.1版本已经把sift surf这两个更为nofree了,换句话说,opencv2.4.1是不支持sift系列函数的...2013-03-20T06:11:00Z2013-03-20T06:11:00Zpatty-pattyhttps://www.cnblogs.com/north-north/【摘要】在windows下编译d_nets费了我将近一周的课余时间。期间问题数不胜数,今天终于成功。 编译d_nets需要安装了opencv的vs,当然也可以自己cmake一下opencv。我是在vs2010上配置opencv各种参数。(1)opencv2.4.1 不支持SIFT 首先我安装的是opencv2.4.1版本,vs2010配置各种路径后,cv::SIFT::等一系列函数均不识别。刚开始接触opencv,最开始一直没找到报错的原因。百度了好久发现,opencv2.4.1版本已经把sift surf这两个更为nofree了,换句话说,opencv2.4.1是不支持sift系列函数的... <a href="https://www.cnblogs.com/north-north/archive/2013/03/20/2971081.html" target="_blank">阅读全文</a>