Skip to main content

Non-parametric multivariate regressions by Alternating Conditional Expectations

Project description

ace is an implementation of the Alternating Conditional Expectation (ACE) algorithm [Breiman85], which can be used to find otherwise difficult-to-find relationships between predictors and responses and as a multivariate regression tool.

The full documentation is hosted at http://partofthething.com/ace. The source code, bug tracker, etc., can be found at: https://github.com/partofthething/ace

What is it?

ACE can be used for a variety of purposes. With it, you can:

  • 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.

The fascinating thing about ACE is that it is a non-parametric multivariate regression tool. This means that it doesn’t make any assumptions about the functional form of the data. You may be used to fitting polynomials or lines to data. Well, ACE doesn’t do that. It uses an iteration with a variable-span scatterplot smoother (implementing local least squares estimates) to figure out the structure of your data. As you’ll see, that turns out to be a powerful difference.

Installing it

On Linux:

sudo pip install ace

On Windows:

pip install ace

Using it

To use, get some sample data:

from ace.samples import wang04
x, y = wang04.build_sample_ace_problem_wang04(N=200)

and run:

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

For some plotting (matplotlib required), try:

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

More details

This implementation of ACE isn’t as fast as the original FORTRAN version, but it can still crunch through a problem with 5 independent variables having 1000 observations each in on the order of 15 seconds. Not bad.

ace also contains a pure-Python implementation of Friedman’s SuperSmoother [Friedman82], the variable-span smoother mentioned above. This can be useful on its own for smoothing scatterplot data.

References

[Breiman85]

L. BREIMAN and J. H. FRIEDMAN, “Estimating optimal transformations for multiple regression and correlation,” Journal of the American Statistical Association, 80, 580 (1985). [PDF at JSTOR]

[Friedman82]

J. H. FRIEDMAN and W. STUETZLE, “Smoothing of scatterplots,” ORION-003, Stanford University, (1982). [PDF at Stanford]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ace-0.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ace-0.2-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

ace-0.2-py2-none-any.whl (23.4 kB view details)

Uploaded Python 2

File details

Details for the file ace-0.2.tar.gz.

File metadata

  • Download URL: ace-0.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ace-0.2.tar.gz
Algorithm Hash digest
SHA256 43dfcdf0a1eacbd7ce6f938a395b3ca04169a295ec73e4baf02599eb6d91fac2
MD5 de8ca95c9411b3aea103c99ab38ec2a0
BLAKE2b-256 07c1d11e7c6068cca9bbd09fb7c8f72dcb5c24af4d8acd62369cec51546eba43

See more details on using hashes here.

File details

Details for the file ace-0.2-py3-none-any.whl.

File metadata

  • Download URL: ace-0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ace-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8624b6700feae7c95d291a6c63ea0a122ea82642bc4dec803c05e21dbe94645e
MD5 5b6e4dea4d08453b988f13dc317e57c3
BLAKE2b-256 c3f00502adf15c44047c2cca38ceb45c6500005baa25b6f72a86c340ed84263b

See more details on using hashes here.

File details

Details for the file ace-0.2-py2-none-any.whl.

File metadata

  • Download URL: ace-0.2-py2-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ace-0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 d3cbbb633fa5af06388e91c7faace980bb38a214ab4405e0a062a1204df12554
MD5 6f3115d2c95c0b9f587292f865b30013
BLAKE2b-256 4b9fda407ba460e8eef4ffd0de1cefc1a7a2f9cce53abc4f5c9237805292c39e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page