Skip to main content

Alternating Conditional Expectation Algorithm

Project description

Build Status PyPI Windows

This project provides a wrapper program of Python for ACE algorithm implementation of Fortran.

Install Binary Distribution

Currently, only 64-bit binary distribution is provided. Run pip install ace_cream to install the binary distribution.

Platform

py3.6

py3.7

py2.7

Windows

T

T

T

MacOS

T

T

Linux

T

T

T

How to build

You need numpy and fortran compiler to build from source.

Windows

  • Install Visual C++ toolchain.

  • Download MinGW-w64 from sourceforge, which provides the necessary fortran compiler

  • Install MinGW-w64 and add {install_dir}\mingw64\bin path to environment variable (make gfortran accessible from command line).

    • (for conda environment) Add {install_dir}\Anaconda3\Scripts to environment variable (make f2py accessible from command line).

Mac

You can use package manager to install gfortran (included within gnu compiler collection). For example, with Homebrew you can use

brew install gcc

Ubuntu

To install gfortran, use the default package manager:

sudo apt-get install gfortran

Run python setup.py install from command line at the project root directory.

How to use

import numpy as np
from ace_cream import ace_cream
# discrete case, binary symmetric channel with crossover probability 0.1
x = np.random.choice([0,1], size=N_SIZE)
n = np.random.choice([0,1], size=N_SIZE, p=[0.9, 0.1])
y = np.mod(x + n, 2)
# set both x(cat=0) and y(cat=-1) as categorical type
tx, ty = ace_cream(x, y, cat=[-1,0])

# continuous case
x = np.random.uniform(0, np.pi, 200)
y = np.exp(np.sin(x)+np.random.normal(size=200)/2)
tx, ty = ace_cream(x, y)

Result

image

image

change log

  1. v0.1 initial commit

  2. v0.2 modify to relative import in __init__.py

  3. v0.3 add support for multiple columns of x and other directions of transformation

  4. v0.4 add f_mapping function and unittests for this function

License

Apache License Version 2.0

Reference

  1. https://en.wikipedia.org/wiki/Alternating_conditional_expectations

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_cream-0.4.post11.tar.gz (35.0 kB view hashes)

Uploaded Source

Built Distributions

ace_cream-0.4.post11-cp37-cp37m-manylinux1_x86_64.whl (417.7 kB view hashes)

Uploaded CPython 3.7m

ace_cream-0.4.post11-cp37-cp37m-macosx_10_14_x86_64.whl (116.0 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

ace_cream-0.4.post11-cp36-cp36m-manylinux1_x86_64.whl (417.6 kB view hashes)

Uploaded CPython 3.6m

ace_cream-0.4.post11-cp35-cp35m-manylinux1_x86_64.whl (418.3 kB view hashes)

Uploaded CPython 3.5m

ace_cream-0.4.post11-cp34-cp34m-manylinux1_x86_64.whl (418.2 kB view hashes)

Uploaded CPython 3.4m

ace_cream-0.4.post11-cp27-cp27mu-manylinux1_x86_64.whl (416.3 kB view hashes)

Uploaded CPython 2.7mu

ace_cream-0.4.post11-cp27-cp27m-win_amd64.whl (114.9 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

ace_cream-0.4.post11-cp27-cp27m-manylinux1_x86_64.whl (416.3 kB view hashes)

Uploaded CPython 2.7m

ace_cream-0.4.post11-cp27-cp27m-macosx_10_14_x86_64.whl (114.6 kB view hashes)

Uploaded CPython 2.7m macOS 10.14+ x86-64

Supported by

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