支持向量机(SVM)及其相关的基于核的学习算法是一类用于非参数分类和回归的机器学习算法。liquidsvm是支持向量机的一种实现方法,其主要特点是:完全集成超参数选择、大数据集和小数据集上的极速、包含多种不同的分类和回归场景,以及对专家的充分灵活性。
liquidSVM的Python项目详细描述
欢迎使用liquidsvm的python绑定。
摘要:
使用下列任一型号安装:
pip install --user --upgrade liquidSVM easy_install --user --upgrade liquidSVM
如果你想编译liquidsvm供你的机器下载 http://www.isa.uni-stuttgart.de/software/python/liquidSVM-python.tar.gz。 对于Windows,在 liquidSVM-python.win-amd64.zip, 对于Mac AT liquidSVM-python.macosx.tar.gz
然后在命令行上尝试此问题
python -m liquidSVM covtype.1000 mc --display=1 **NOTE**: it might be possible that there is a problem with the last line if there are files called ``liquidSVM*`` in the current directory, so change to some other or a newly created one.
或者在交互式shell中使用它
fromliquidSVMimport*model=mcSVM(iris,iris_labs,display=1,threads=2)result,err=model.test(iris,iris_labs)result=model.predict(iris)reg=LiquidData('reg-1d')model=lsSVM(reg.test,display=1)result,err=model.test(reg.test)
更多信息可以在 demo[jupyter notebook] 在
fromliquidSVMimport*help(SVM)help(doc.configuration)
liquidSVM和这些绑定都是在AGPL3.0下提供的 执照。
本机库编译
流式SVM在C++中实现,因此需要一个本地库。 已编译并包含在python进程中。Windows的二进制文件是 包括,但是如果可能的话,我们建议您编译它 使每台机器都能充分发挥性能。
要设置编译器选项,请使用环境变量 LIQUIDSVM_CONFIGURE_ARGS。其中的第一个词可以是 以下内容:
- native
- 通常是最快的,但结果库通常不是 可移植到其他机器。
- generic
- 对于大多数机器来说应该是可移植的,但速度较慢(系数2到4?)
- debug
- 在激活调试的情况下编译(可以使用gdb进行调试)
- empty
- 未激活特殊编译选项。
环境变量的其余部分将传递给 编译器。提取 http://www.isa.uni-stuttgart.de/software/python/liquidSVM-python.tar.gz 然后进入目录。在Linux和MacOS X上,用于 实例:
LIQUIDSVM_CONFIGURE_ARGS="native -mavx2" python setup.py bdist LIQUIDSVM_CONFIGURE_ARGS=generic python setup.py bdist
- macos:
- 安装xcode,然后安装可选的命令行工具 从中。
- windows:
如果安装了visualstudio,则应该安装一个 环境变量,如%VS90COMNTOOLS%(用于visualstudio 2015年)。不过,setup.py似乎还需要这些信息 在%VS90COMNTOOLS%中,复制该环境变量或用于 示例:
set VS90COMNTOOLS=%VS140COMNTOOLS% **Note:** At the moment the Visual Studio for Python only gives Version 9.0 and this is too old for compilation.