码迷,mamicode.com
首页 >  
搜索关键字:python实现    ( 3105个结果
隐马尔可夫模型学习小记——forward算法
首先是forward算法的Python实现:#-*-coding:utf-8-*-__author__ = 'ZhangHe'def forward(N,M,A,B,P,observed): p = 0.0 #观察到的状态数目 LEN = len(observed) #中间概...
分类:编程语言   时间:2015-01-16 23:43:13    阅读次数:295
leetcode 【 Plus One 】python 实现
题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is...
分类:编程语言   时间:2015-01-16 23:37:11    阅读次数:215
leetcode 【 Remove Duplicates from Sorted Array II 】python 实现
题目:Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ...
分类:编程语言   时间:2015-01-16 23:36:59    阅读次数:686
leetcode 【 Remove Duplicates from Sorted Array 】python 实现
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
分类:编程语言   时间:2015-01-16 22:14:33    阅读次数:223
leetcode 【 Remove Element 】python 实现
题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't ...
分类:编程语言   时间:2015-01-16 22:14:22    阅读次数:257
Python实现KNN算法
Python实现KNN算法 KNN算法的实际用处很多,主要用于分类阶段,是一个基础的分类算法。KNN主要基于距离的计算,一般可以在原始的欧氏空间中计算样本之间的距离。改进版本有:先特征提取到一个更加鉴别的空间中,然后计算距离;或者先使用metric learning度量学习的技术来获得一个鉴别的度量空间,然后计算样本间的马氏距离。 不管怎么说,KNN在很多算法的分类阶段都可以用到,我们这里用python实现KNN。...
分类:编程语言   时间:2015-01-16 19:19:41    阅读次数:233
leetcode 【 Add Two Numbers 】 python 实现
题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing...
分类:编程语言   时间:2015-01-16 14:37:18    阅读次数:247
Python实现简单的http服务器程序
主要的需求是这样的,需要调用服务器端的程序获取GPU服务器的信息并且返回给前端显示出来,那么就需要完成一个服务器端的程序,获取服务器的数据之后将数据返回(以JSON格式)。...
分类:编程语言   时间:2015-01-13 23:20:57    阅读次数:348
leetcode 【 Convert Sorted List to Binary Search Tree 】python 实现
题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.代码:oj测试通过Runtime:178 ms 1 # Definition...
分类:编程语言   时间:2015-01-11 20:18:51    阅读次数:235
用python实现Monte Carlo Tic-Tac-Toe(井字游戏)
1 """ 2 Monte Carlo Tic-Tac-Toe Player @author dark_guard 3 """ 4 5 import random 6 import poc_ttt_gui 7 import poc_ttt_provided as provid...
分类:编程语言   时间:2015-01-11 19:07:55    阅读次数:280
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!