Python 机器学习工具包 MILK

码农软件 · 软件分类 · 机器学习/深度学习 · 2019-08-06 06:44:07

软件介绍

MILK(MACHINE LEARNING TOOLKIT) 是 Python 语言的机器学习工具包。

它主要是在很多可得到的分类比如 SVMS、K-NN、随机森林以及决策树中使用监督分类法,它还可执行特征选择。这些分类器在许多方面相结合,可以形成不同的例如无监督学习、密切关系传播和由 MILK 支持的 K-means 聚类等分类系统。

MILK 关注速度和内存的使用,因此大多数对性能比较敏感的代码都是用 C++ 编写的。为了方便起见,基于 Python 实现了接口。

示例代码

测试对一些 features,labels 数据的分类情况,通过交叉验证测量:

import numpy as np
import milk
features = np.random.rand(100,10) # 2d array of features: 100 examples of 10 features each
labels = np.zeros(100)
features[50:] += .5
labels[50:] = 1
confusion_matrix, names = milk.nfoldcrossvalidation(features, labels)
print 'Accuracy:', confusion_matrix.trace()/float(confusion_matrix.sum())

如果想要使用分类器,可以创建一个 learner object 并调用它的 train() 方法:

import numpy as np
import milk
features = np.random.rand(100,10)
labels = np.zeros(100)
features[50:] += .5
labels[50:] = 1
learner = milk.defaultclassifier()
model = learner.train(features, labels)
# Now you can use the model on new examples:
example = np.random.rand(10)
print model.apply(example)
example2 = np.random.rand(10)
example2 += .5
print model.apply(example2)

特性

  • 支持向量机。使用封装了 pythonesque 的 libsvm solver

  • LASSO 算法

  • K-means 使用的内存小,可有效地对数百万个实例进行集群

  • 随机森林

  • 自组织地图

  • 逐步判别分析特征选择

  • 非负矩阵分解(Non-negative Matrix Factorization,NMF)算法

  • AP(Affinity Propagation)聚类算法

本文地址:https://www.codercto.com/soft/d/11743.html

Java Servlet & JSP Cookbook

Java Servlet & JSP Cookbook

Bruce W. Perry / O'Reilly Media / 2003-12-1 / USD 49.99

With literally hundreds of examples and thousands of lines of code, the Java Servlet and JSP Cookbook yields tips and techniques that any Java web developer who uses JavaServer Pages or servlets will ......一起来看看 《Java Servlet & JSP Cookbook》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具