clicumu / doepipeline

A python package for optimizing processing pipelines using statistical design of experiments (DoE).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Factor value definition

druvus opened this issue · comments

I have tested the code and I think we need a replacement for the quick fix f5298d6. To many software are quite picky to be feeded by the correct type. I think the best solution, as suggested by @RickardSjogren, would be to add a int/float definition field to the yaml file.

To follow a more DoE-esque terminology I think that the introduction of categorical and ordinal variables would be most fitting (I actually believed that I had them specified).

Factors perhaps should be quantitative by default but be changed with a type tag. I propose the following factor structure:

factors:
    CategoricalFactor:
        type: categorical
        choices:
            - A
            - B
            - C
    OrdinalFactor:  # Allowed values are 1, 2, 3, 4
        type: ordinal
        min: 1
        max: 4
    QuantitativeFactor:
        min: 0
        max: 4
        low_init: 1.5
        high_init: 2.2

Exactly how to make the designs I guess should be up to @danisven, who has been teaching DoE ;)

That factor structure looks good to me.

I've pushed new code to daniel_dev that essentially differentiates the Factor class into two base classes - NumericalFactor and CategoricalFactor. NumericalFactor in turn has two subclasses - OrdinalFactor and QuantitativeFactor. QuantitativeFactor works just like the Factor did before, but OrdinalFactor is meant to deal only with integer values. Factors are still instantiated by calling designer.Factor, but this is now a factory function that will return the correct factor class. CategoricalFactor is not yet implemented and raises an NotImplementedError.

Edit: Each factor takes a 'type' flag in the yaml file which must be one of {ordinal, quantitative, categorical}. If no 'type' can be found for a factor, it defaults to quantitative.

I believe this is already solved