摘要: from sklearn import datasets import numpy as np X, y = datasets.make_blobs(n_features=2, centers=2) from sklearn.svm import LinearSVC from sklearn.svm 阅读全文
posted @ 2016-03-31 22:47 qqhfeng16 阅读(6654) 评论(0) 推荐(0) 编辑
摘要: http://docs.scipy.org/doc/numpy/reference/generated/numpy.percentile.html numpy.percentile(a, q, axis=None, out=None, overwrite_input=False, interpola 阅读全文
posted @ 2016-03-31 21:56 qqhfeng16 阅读(2447) 评论(0) 推荐(0) 编辑
摘要: #调整随机森林的参数(调整n_estimators随机森林中树的数量默认10个树,精度递增显著) from sklearn import datasets X, y = datasets.make_classification(n_samples=10000,n_features=20,n_informative=15,flip_y=.5, weights=[.2, .8]) import ... 阅读全文
posted @ 2016-03-31 18:36 qqhfeng16 阅读(15703) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-03-31 18:11 qqhfeng16 阅读(435) 评论(0) 推荐(0) 编辑
摘要: #调整随机森林的参数(调整max_features,结果未见明显差异) from sklearn import datasets X, y = datasets.make_classification(n_samples=10000,n_features=20,n_informative=15,flip_y=.5, weights=[.2, .8]) import numpy as np t... 阅读全文
posted @ 2016-03-31 18:10 qqhfeng16 阅读(7205) 评论(0) 推荐(0) 编辑
摘要: #In the next recipe, we'll look at how to tune the random forest classifier. #Let's start by importing datasets: from sklearn import datasets X, y = d 阅读全文
posted @ 2016-03-31 17:06 qqhfeng16 阅读(28305) 评论(0) 推荐(0) 编辑
摘要: pip类似RedHat里面的yum,安装Python包非常方便。本节详细介绍pip的安装、以及使用方法。 1、pip下载安装 1.1 pip下载 1 # wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5= 阅读全文
posted @ 2016-03-31 11:33 qqhfeng16 阅读(445) 评论(0) 推荐(0) 编辑
摘要: import matplotlib.pyplot as plt from sklearn import datasets import numpy as np from sklearn.tree import DecisionTreeClassifier n_features = 200 X, y 阅读全文
posted @ 2016-03-31 11:09 qqhfeng16 阅读(1847) 评论(0) 推荐(0) 编辑