摘要: Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou 阅读全文
posted @ 2018-08-06 14:57 lypbendlf 阅读(188) 评论(0) 推荐(0) 编辑
摘要: A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number 阅读全文
posted @ 2018-08-06 12:19 lypbendlf 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 来源于:网易云课堂-哈工大-王宏志老师 1.暴力美学 问题1.布尔表达式的可满足性问题(NP完全问题) 解1.时间复杂度是2^n. 问题2.8迷问题 解2.转换为树搜索问题,对可能的移动结果生成解空间 问题3.哈密顿环问题(NP完全问题) 解3.从原点出发,对可能访问到的点生成解空间,并且从每个可以 阅读全文
posted @ 2018-08-01 19:05 lypbendlf 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1.从代价函数谈起SVM 图一 根据将y=0||y=1,得到逻辑回归的代价函数,那么SVM和其代价函数是相似的,只不过是引入了cost0与cost1,并且自变量使用了theta_T*x(i),并且由于SVM的通常表示方法,得到了如下的优化函数假设: 在代价函数项加上了系数C(=1/lamda),也就 阅读全文
posted @ 2018-07-30 22:33 lypbendlf 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1.神经网络模型1 图1 这是一个神经网络的模型,通常设置一个x0,作为偏执单元或者偏置(bias)神经元。 图2 这里最后一句话,说的是系数矩阵θ,神经网络模型中,如果当前在j层有s_j个单元,在j+1层有s_j+1个单元,那么第j层的系数矩阵theta_j,是s_j+1(s_j +1)维的。 / 阅读全文
posted @ 2018-07-30 21:09 lypbendlf 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 链接:https://www.nowcoder.com/questionTerminal/4b20ed271e864f06ab77a984e71c090f来源:牛客网PAT 1018 Public Bike Management There is a public bike service in H 阅读全文
posted @ 2018-07-30 10:45 lypbendlf 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c 阅读全文
posted @ 2018-07-29 12:55 lypbendlf 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1.过度拟合overfitting 过度拟合,因为有太多的特征+过少的训练数据,学习到的假设可能很适应训练集,但是不能泛化到新的样例。即泛化generalize能力差。 解决办法: 1.手动/使用选择算法来确定保留的特征。 2.当所有的特征都对结果有一定贡献时,需要正则化,保留所有特征,但是降低θ的 阅读全文
posted @ 2018-07-28 18:00 lypbendlf 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1.极大似然估计-逻辑回归代价函数的简化 Andrew Ng的ML视频上讲到:逻辑回归的代价函数可以用最大似然估计法进行简化成上图中第二个式子。 所以学习了一下极大似然估计原理: 2.求偏导 逻辑回归代价函数对θj求偏导,得到手写的部分。手动求解偏导函数如下: 卡住了,还是不太会求,怎么求啊!怎么可 阅读全文
posted @ 2018-07-28 16:17 lypbendlf 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c 阅读全文
posted @ 2018-07-28 13:55 lypbendlf 阅读(129) 评论(0) 推荐(0) 编辑