上一页 1 2 3 4 5 6 7 8 9 ··· 28 下一页

2015年8月1日

摘要: 作业的内容主要是实现AdaBoost-Stump的算法。作业真是给人一种扮猪吃老虎的感觉,AdaBoost-Stump原理看似很简单,但是却埋了思维陷阱。可以通过Q12~Q18的python源码如下(训练数据是train.dat, 测试数据是test.dat)#encoding=utf8import... 阅读全文
posted @ 2015-08-01 17:22 承续缘 阅读(1266) 评论(0) 推荐(0) 编辑
摘要: 首先用一个形象的例子来说明AdaBoost的过程:1. 每次产生一个弱的分类器,把本轮错的样本增加权重丢入下一轮2. 下一轮对上一轮分错的样本再加重学习,获得另一个弱分类器经过T轮之后,学得了T个弱分类器,再将这T个弱分类器组合在一起,形成了一个强分类器。由于每一轮样本的权重都在变化,因此分类器学习... 阅读全文
posted @ 2015-08-01 17:07 承续缘 阅读(1486) 评论(1) 推荐(1) 编辑

2015年7月22日

摘要: 题目:Given an integer, write a function to determine if it is a power of two.代码:class Solution {public: bool isPowerOfTwo(int n) { if ( n>... 阅读全文
posted @ 2015-07-22 07:23 承续缘 阅读(280) 评论(0) 推荐(0) 编辑

2015年7月14日

摘要: 题目:Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the n... 阅读全文
posted @ 2015-07-14 19:25 承续缘 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exa... 阅读全文
posted @ 2015-07-14 18:39 承续缘 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 题目:Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, exc... 阅读全文
posted @ 2015-07-14 17:25 承续缘 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's t... 阅读全文
posted @ 2015-07-14 13:00 承续缘 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目:Invert Binary TreeTotal Accepted:20346Total Submissions:57084My SubmissionsQuestionSolutionInvert a binary tree. 4 / \ 2 7 / \ / \1 ... 阅读全文
posted @ 2015-07-14 12:48 承续缘 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedi... 阅读全文
posted @ 2015-07-14 12:35 承续缘 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowe... 阅读全文
posted @ 2015-07-14 10:55 承续缘 阅读(249) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 28 下一页

导航