交替条件期望的非参数多元回归

ace的Python项目详细描述


https://travis-ci.org/partofthething/ace.svg?branch=develop

ace是交替条件期望(ace)算法的一个实现[Breiman85], 它可以用来发现其他很难找到的预测器之间的关系 作为多元回归工具。

此项目的代码以及问题跟踪程序等是 hosted on GitHub。 文档位于http://partofthething.com/ace

这是什么?

ace可用于多种用途。有了它,您可以:

  • build easy-to-evaluate surrogate models of data. For example, if you are optimizing input parameters to a complex and long-running simulation, you can feed the results of a parameter sweep into ACE to get a model that will instantly give you predictions of results of any combination of input within the parameter range.
  • expose interesting and meaningful relations between predictors and responses from complicated data sets. For instance, if you have survey results from 1000 people and you and you want to see how one answer is related to a bunch of others, ACE will help you.

ace的迷人之处在于它是一个non-parametric多元回归。 工具。这意味着它不会对数据的函数形式做任何假设。 可以使用多项式或直线拟合数据。好吧,艾斯不会那么做的。它 使用具有可变跨度散点图平滑器(实现局部最小值)的迭代 平方估计)来计算数据的结构。如你所见 结果是一个巨大的不同。

安装它

ace在Python Package Index中可用, 并可以简单地安装如下。

在Linux上:

sudo pip install ace

在Windows上,使用:

pip install ace

直接从来源:

git clone git@github.com:partofthething/ace.git
cd ace
python setup.py install

注意

如果没有git,可以直接从 here

您可以通过运行自动测试来验证安装是否成功完成 安装目录中的套件:

python -m unittest discover -bv

使用它

要使用,请获取一些示例数据:

fromace.samplesimportwang04x,y=wang04.build_sample_ace_problem_wang04(N=200)

然后运行:

fromaceimportmodelmyace=model.Model()myace.build_model_from_xy(x,y)myace.eval([0.1,0.2,0.5,0.3,0.5])

对于某些绘图(需要matplotlib),请尝试:

fromaceimportaceace.plot_transforms(myace.ace,fname='mytransforms.pdf')myace.ace.write_transforms_to_file(fname='mytransforms.txt')

请注意,您也可以使用空格分隔来加载数据。 文本文件:

myace.build_model_from_txt(fname='myinput.txt')

警告

输入的数据点越多,结果越好。 小心少于50个数据点。

演示

Sample ACE Problems部分。

其他详细信息

ace的这个实现没有原来的fortran版本快,但是它可以 仍然处理一个有5个自变量的问题,每个自变量有1000个观测值 大约15秒。不错。

ace还包含friedman的supersmoother[Friedman82]的纯python实现, 上面提到的可变跨度更平滑。这本身就很有用 用于平滑散点图数据。

历史记录

ace算法由breiman和friedman于1985年出版,最初的 Fortran源代码可从Friedman’s webpage获得。

动机

在这个包之前,ace算法只有在python中通过使用rpy2模块才可用 加载到r统计语言的acepack包中。这个包是纯python 在原出版物的基础上,采用现代软件实践,重新编写了ace算法。 这个包比原来的fortran代码慢,但更容易理解。这个包裹 应该适合中等重量的数据和作为学习工具。

另外,使用f2py在python中运行最初的fortran代码也非常容易。

关于作者

这个包是由尼克图兰,一个专门研究反应堆物理的核工程师发明的。 他的论文导师约翰李教授让他接触了ace,并将其用于 多学科目标函数评价博士学位论文 核反应堆堆芯设计优化研究。

许可证

这个包是在麻省理工学院的许可下发布的,reproduced here

参考文献

[Breiman85](1, 2) L. BREIMAN and J. H. FRIEDMAN, “Estimating optimal transformations for multiple regression and correlation,” Journal of the American Statistical Association, 80, 580 (1985). [Link1]
[Friedman82]J. H. FRIEDMAN and W. STUETZLE, “Smoothing of scatterplots,” ORION-003, Stanford University, (1982). [Link2]
[Wang04]D. WANG and M. MURPHY, “Estimating optimal transformations for multiple regression using the ACE algorithm,” Journal of Data Science, 2, 329 (2004). [Link3]
[Touran12]N. TOURAN, “A Modal Expansion Equilibrium Cycle Perturbation Method for Optimizing High Burnup Fast Reactors,” Ph.D. dissertation, Univ. of Michigan, (2012). [The Thesis]

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用唯一的按钮标签单击按钮   代码生成如何使用Java codeModel为数组的特定索引赋值   java如何批量执行Camel SQL插入   java iText 7将ltv添加到现有签名   内存管理Java应用程序突然停止几天后(810)   带MySQL的java注册表单JavaFX在intellij中失败   如何使用eclipse为windows azure java项目启用远程调试   一种通用的java输入输出设计模式   java Android XML(RSS)忽略引号(“”)   java帮助:安卓中的8 X 10 2维按钮数组   java启动Android项目   JWrapper构建java应用程序   java如何在Android应用程序中设置基于日期/时间的默认页面加载?   java循环程序在完成后返回到起点   java Hibernate:更好的整体类还是多类映射?   回溯数独解算器的递归问题[Java]   java查找类用法   java如何在SpringWebFlow中将多个模型绑定到一个视图?