- 博客(240)
- 资源 (20)
- 收藏
- 关注
原创 Linux学习-ps aux指令
如果直接用ps命令,会显示所有进程的状态,通常结合grep命令查看某进程的状态。如果想对进程时间监控,应该用 top 工具。下面主要介绍下ps指令。linux进程状态在Linux中,进程存在5中状态运行状态(正在运行或在运行队列中等待)中断状态(休眠中, 受阻, 在等待某个条件的形成或接受到信号)不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生)僵死状态(进程已终止, 但进程
2015-08-02 22:37:43 2658
原创 机器学习-训练模型的保存与恢复(sklearn)
在做模型训练的时候,尤其是在训练集上做交叉验证,通常想要将模型保存下来,然后放到独立的测试集上测试,下面介绍的是Python中训练模型的保存和再使用。scikit-learn已经有了模型持久化的操作,导入joblib即可from sklearn.externals import joblib模型保存>>> os.chdir("workspace/model_save")>>> from sklea
2015-07-31 20:52:28 66276 24
原创 机器学习-CrossValidation交叉验证Python实现
版权声明:本文为原创文章,转载请注明来源。1.原理1.1 概念交叉验证(Cross-validation)主要用于模型训练或建模应用中,如分类预测、PCR、PLS回归建模等。在给定的样本空间中,拿出大部分样本作为训练集来训练模型,剩余的小部分样本使用刚建立的模型进行预测,并求这小部分样本的预测误差或者预测精度,同时记录它们的加和平均值。这个过程迭代K次,即K折交叉。其中,把每个样本的预测误差平方加和
2015-07-28 19:34:40 88076 4
原创 windows下sshfs挂载远程目录-server could not connect故障解决
使用sshfs挂载服务器上面的目录到windows中,轻松方便。在之前的系统上挂载,没出问题。最近买了块固态硬盘,装了个系统。结果在系统上运行sshfs时报如下错误: 其实很简单,就是DokanMounter服务没有开启。到控制面板–>管理工具–>服务,找到DokanMounter服务,先启动,然后设置为自动启动,下次就不要再来设置了。 成功挂载之后,如下图所示 此时,我的电
2015-07-28 08:55:06 6630 3
原创 机器学习-sklearn库的Cross Validation
一个Windows操作系统能够使用的pythonIDE winPython下载地址:WinPython_2.7传统的F-measure或平衡的F-score (F1 score)是精度和召回的调和平均值:F1=2precision∗recallprecision+recallF_1 = 2\dfrac{precision * recall}{precision + recall}1.Cross
2015-07-24 22:27:05 29236 1
原创 机器学习-组合算法总结
组合模型组合模型一般要比单个算法要好,下面简单的介绍下Bootstraping, Bagging, Boosting, AdaBoost, RandomForest 和Gradient boosting这些组合型算法.1.BootstrapingBootstraping: 名字来自成语“pull up by your own bootstraps”,意思就是依靠你自己的资源,称为自助法,它是一种有放
2015-07-24 22:23:17 3958
原创 Python学习-Numpy数据处理
前言标准的python中用list保存数值,可以当数组使用。但由于列表的元素是任意对象,因此列表中保存的是对象的指针。对于数值运算来说,这种结构显然会浪费内存和CPU计算时间。此外,python还提供了array模块,但由于其不支持多维数组,因此也不适合数值计算。So,Numpy正好弥补了这些不足,Numpy提供了两个基本的对象:ndarray和ufunc。ndarray是存储单一数据
2015-07-24 22:19:25 3043
翻译 机器学习scikit-learn入门教程
原文链接:http://scikit-learn.github.io/dev/tutorial/basic/tutorial.html章节内容在这个章节中,我们主要介绍关于scikit-learn机器学习词库,并且将给出一个学习样例。机器学习:问题设置通常,一个学习问题是通过一系列的n个样本数据来学习然后尝试预测未知数据的属性。如果每一个样本超过一个单一的数值,例如多维输入(也叫做多维数据),那么它
2015-07-20 19:27:49 23107 1
原创 Python学习-centos7.0下matplotlib安装及问题解决
Windows下matplotlib的安装,前面已经介绍了Python学习-windows安装Python以及matplotlib.pyplot包,由于现在在服务器上跑程序,需要在centos 7.0上安装,那么就做个笔记。首先matplotlib是需要numpy先行包支持的,这里,我已经安装了numpy,下面安装matplotlib。matplot需要一些其他软件支持 这时需要安装freetyp
2015-07-19 16:22:28 7504
原创 Linux-github 搭建静态博客
1.在Github上创建一个新的Repository到你的github上 https://github.com去create a new repository命名为 github.myblog 2.本地安装Jekyll-Bootstrap如果本地centos没有git,使用yum安装$ yum install git克隆jekyll-bootstrap$ git clone https://git
2015-07-17 16:00:58 2171
原创 Python学习-一个简单的计时器
在实际开发中,往往想要计算一段代码运行多长时间,下面我将该功能写入到一个函数里面,只要在每个函数前面调用该函数即可,见下面代码:#--------------------------------#一个记时器,只要在函数前面写上@fun_timer即可import timefrom functools import wraps def fun_timer(function): @wr
2015-07-16 16:27:38 8693
原创 Git命令汇总
1.github简介Git是一个分布式的版本控制系统,最初由Linus Torvalds编写,用作Linux内核代码的管理。在推出后,Git在其它项目中也取得了很大成功,尤其是在Ruby社区中。目前,包括Rubinius、Merb和Bitcoin在内的很多知名项目都使用了Git。Git同样可以被诸如Capistrano和Vlad the Deployer这样的部署工具所使用。github网址:www
2015-07-11 19:01:49 1402
原创 PSSM特征-从生成到处理
以下代码均为个人原创,如有疑问,欢迎交流。新浪微博:拾毅者本节内容:pssm生成pssm简化标准的pssm构建滑动pssm生成在基于蛋白质序列的相关预测中,使用PSSM打分矩阵会得将预测效果大大提高,同时,如果使用滑动的PSSM,效果又会进一步提高。这里主要以分享代码为主,下面介绍下PSSM从生成到处理的全过程。1.PSSM的生成PSSM的生成有多种方式,这里使用的psiblast软件,n
2015-07-07 22:34:00 12446 9
原创 机器学习算法-Adaboost
本章内容组合相似的分类器来提高分类性能应用AdaBoost算法处理非均衡分类问题主题:利用AdaBoost元算法提高分类性能1.基于数据集多重抽样的分类器 - AdaBoost 优点 泛化错误率低,易编码,可以应用在大部分分类器上,无需参数调整 缺点 对离群点敏感 适合数据类型 数值型和标称型数据bagging:基于数据随机重抽样的分类器构建方法自举汇聚法(b
2015-07-05 19:14:42 5506 1
原创 数据预处理-PDB文件处理代码
以下代码为个人原创,python实现,是处理PDB文件的常用代码,仅供参考!1.下载PDB文件下面是一个下载PDB文件的函数,传入的参数是一个写有pdb名字的namefile文件,函数的核心部分是三个系统命令,先通过wget下载,然后解压,最后替换名字。def downloadpdb(namefile): inputfile = open(namefile, 'r') for eac
2015-07-05 10:04:42 4659
原创 Python学习笔记-小记
1.字符串string判断一个字符(char)是数字还是字母 str.isalpha #判断是否为字母str.isdigit #判断是否为数字判断一个字符串是否为空if not str.strip(): #判断是否为空,true表示空向字符串添加内容str = ''.join('love')得到字符串固定长度的字串str = str1[1:3] #得到从下标1开始到下标3之前的字符,下标3的字符不
2015-06-26 20:48:14 1271
原创 R语言-merge和rbind
rbind使用方式 合并两个数据集,要求两个数据集的列数相等:rbind(parameter1,parameter2)合并多个数据集,各个数据集的列数相等:rbind(parameter1,parameter2,...,parametern)从数据集中提取数据test <- rbind()for (i in 1:length(s_5)){ test <- rbind(test,dat
2015-06-15 10:37:44 41076
原创 Leetcode[120]-Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,7],
2015-06-14 17:03:43 1280
原创 C++ vector用法小记
最近在leetcode上面做题,STL的vector用的甚多,这里稍微的总结下vector的一些常用方法,包括一维的和二维的,暂时能想到的就给记下了。一维vector创建一维vector: vector<int> nums;//不指定长度vector<int> nums(n); // 指定长度为n 添加元素nums.push_back(1);//直接从数组末端添加nums[i] = 1;//直接
2015-06-14 13:51:21 5650 1
原创 Leetcode[63]-Unique Paths II
Follow up for “Unique Paths”:Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the grid.For ex
2015-06-14 13:29:34 948
原创 Leetcode[62]-Unique Paths
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the botto
2015-06-14 12:59:05 1180
原创 Leetcode[70]-Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?题意:给你一个n阶的台阶,你一次最多只能上2个台阶,请问一共有多少个走法?
2015-06-14 12:27:58 917
原创 Leetcode[198]-House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses
2015-06-14 11:18:29 1055
转载 化抽象为具体学动态规划
最近在看动态规划,这篇文章是0-1背包问题,看到这个具体化的例子真的讲的不错,收藏了,顺便附带了原文评论中的分析部分!原文地址:http://www.cnblogs.com/sdjl/articles/1274312.html对于动态规划,每个刚接触的人都需要一段时间来理解,特别是第一次接触的时候总是想不通为什么这种方法可行,这篇文章就是为了帮助大家理解动态规划,并通过讲解基本的01背包问题来引导读
2015-06-14 09:32:03 1128
原创 最长递增子序列长度算法
求最长连续子序列的长度,数字保存在数组中使用动态规划算法,理解状态转移,dp[i]表示i位置下的最大连续子序列长度。初始状态dp[0] = 1,表示在数组下标为0的时候,它的最长子序列长度就是1,接着从1开始从左到右扫描,如果后一个数大于前一个数,则它的最长子序列长度增加1,否则,此位置的最长子序列长度置为1,同时记录下当前的最大子序列长度;最后返回记录的最大连续子序列变量。代码如下:Cod
2015-06-13 22:15:15 1312
原创 Leetcode[215]-Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example, Given[3,2,1,5,6,4]and k = 2, return 5.Note:
2015-06-13 20:58:12 1604
原创 Leetcode[114]-Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example, Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like: 1 \ 2
2015-06-13 13:01:06 1397
原创 Leetcode[103]-Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between).For example: Given binary tree
2015-06-13 12:39:09 997
原创 Leetcode[98]-Validate Binary Search Tree
Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than
2015-06-13 12:19:54 1035
原创 Leetcode[107]-Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example: Given binary tree {3,9,20,#,#,15,7}, 3
2015-06-13 11:08:55 1560
原创 Leetcode[102]-Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example: Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20 / \ 1
2015-06-13 10:49:07 1279
原创 Leetcode[145]-Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recursive solution is trivial, could
2015-06-13 10:10:29 1088
原创 Leetcode[144]-Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes’ values.For example: Given binary tree{1,#,2,3}, 1 \ 2 / 3return [1,2,3].递归遍历:/**C++ * Definition for a binary tree n
2015-06-13 09:24:24 852
原创 Leetcode[9]-Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.Some hints: Could negative integers be palindromes? (ie, -1)If you are thinking of converting the integer to string, note the
2015-06-13 08:45:03 901
原创 Leetcode[7]-Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321取一个数的最后一位,用x % 10,取一个数的前n-1位(共n位),用x/10,每一次取的时候,都将上一次取的数乘以10,然后再加上末尾的数即可,代码如下:Code(C++)class Solution {public
2015-06-12 23:09:40 999
原创 Leetcode[110]-Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by
2015-06-12 23:00:48 1068
原创 Leetcode[173]-Binary Search Tree Iterator
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and hasN
2015-06-12 22:34:58 700
原创 Leetcode[96]-Unique Binary Search Trees
Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, Given n = 3, there are a total of 5 unique BST’s. 1 3 3 2 1 \ /
2015-06-12 21:39:07 1666
原创 Leetcode[226]-Invert Binary Tree
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia: This problem was inspired by this original tweet by Max Howell: Google:
2015-06-12 17:32:00 1640
原创 Leetcode[113]-Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.For example: Given the below binary tree and sum = 22, 5 / \
2015-06-12 16:33:27 1809
visio_2010_64位.part3.rar
2018-04-29
visio 2010 64 bit-part2
2018-04-29
visio 2010 64 bit-part1
2018-04-29
visio 2010 64 bit-part4
2018-04-29
决策树算法python实现
2015-05-25
python2.7.5安装及其相应的matplotlib的包及依赖
2015-05-25
jQuery+Struts+Ajax无刷新分页
2015-04-13
jasperreports-5.5.1_struts2.3整合用到的jar包
2014-05-28
php-5.3.6-Win32-VC9-x64.zip
2014-03-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人