Git Product home page Git Product logo

fatld's Introduction

Four And Two Level Designs

PyPI version CI

The fatld package contains functionality to generate and characterize designs with four-and-two-level (FATL) factors. Design characteristics include word length pattern, defining relation, and number of clear interactions. For more information about the package see the documentation at https://abohyndoe.github.io/fatld/. A large collection of FATL designs can be explored interactively using a web app at https://abohyndoe.shinyapps.io/fatldesign-selection-tool/.

Usage

The package can be used from Python:

>>> import fatld
>>> D = fatld.Design(runsize=32, m=1, cols=[21, 27, 29])
>>> D.wlp()
[1, 3, 3, 0, 0]
>>> D.defining_relation()
['A1cef', 'A3deg', 'A1cdeh']
>>> print("There are %s 2-2 interactions clear from any main effect or other two-factor interaction." % D.clear('2-2'))
There are 6 2-2 interactions clear from any main effect or other two-factor interaction.
>>> print("The design contains %s four-level factors and %s two-level factors" % (D.m, D.n))
The design contains 1 four-level factors and 6 two-level factors

For more examples see the documentation.

Installation

The Python interface to the package is available on pypi. Installation can be done using the following command:

pip install fatld

Development

All development is done in a virtual environment based on poetry, activate it using:

poetry shell

Code style

  • Try to follow the PEP 8 style guide. A usefull tool for automated formatting is black. We do allow lines upto 120 characters.

  • Document functions using the Numpy docstring convention

  • Linting is based on ruff, configuration is found in the pyproject.toml file.

  • Tests are ran using pytest and a coverage report can be generated using coverage inside the virtual environment:

    coverage run -m pytest tests
    coverage report -m

Submitting code

If you would like to contribute, please submit a pull request. (See the Github Hello World example, if you are new to Github).

By contributing to the repository you state you own the copyright to those contributions and agree to include your contributions as part of this project under the BSD license.

Bugs reports and feature requests

To submit a bug report or feature request use the Github issue tracker. Search for existing and closed issues first. If your problem or idea is not yet addressed, please open a new issue.

Contact

For further information please contact alexandre dot bohyn at kuleuven dot be

fatld's People

Contributors

abohyndoe avatar saif-ismail avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

saif-ismail

fatld's Issues

Add a `from_array` function

This function would create a Design object from a numpy array containing a FATL design.
The function would:

  • check that the array only has 4 or 2 level factors
  • compute basic factors out of the four-level factors (since they're always defined in the same way)
  • try to find column numbers out of the BF previously defined
  • raise a error if no column numbers could be found (specifying where it failed)
  • output a design object

`from_array` creates extra columns

def from_array(mat: np.ndarray, zero_coded: bool = True) -> Design:

In the example of the design:
Design(runsize=32, m=2, cols=[5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26])

Removing four-level factor generates a design with m=1, and n=20 but the columns are
[4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 21, 22, 24, 25, 26, 28, 29]
and two columns here should not be part of these.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.