7bd676c9ab6b23ec93499fd72aeadee3a334a163,skopt/utils.py,,normalize_dimensions,#Any#,443

Before Change


         NOTE: The upper and lower bounds are inclusive for `Integer`
         dimensions.
    
    dim_types = [check_dimension(d) for d in dimensions]
    is_cat = all([isinstance(d, Categorical) for d in dim_types])
    if is_cat:
        transformed_dims = [check_dimension(d, transform="identity")
                            for d in dimensions]
    else:
        transformed_dims = []
        for dim_type, dim in zip(dim_types, dimensions):
            if isinstance(dim_type, Categorical):
                transformed_dims.append(
                    check_dimension(dim, transform="onehot")
                    )
            // To make sure that GP operates in the [0, 1] space
            else:
                transformed_dims.append(
                    check_dimension(dim, transform="normalize")
                    )
    return transformed_dims

After Change


            if isinstance(dimension, Categorical):
                transformed_dimensions.append(dimension)
            // To make sure that GP operates in the [0, 1] space
            elif isinstance(dimension, Real):
                transformed_dimensions.append(
                    Real(dimension.low, dimension.high, dimension.prior,
                         transform="normalize")
                    )
            elif isinstance(dimension, Integer):
                transformed_dimensions.append(
                    Integer(dimension.low, dimension.high,
                            transform="normalize")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: scikit-optimize/scikit-optimize
Commit Name: 7bd676c9ab6b23ec93499fd72aeadee3a334a163
Time: 2017-08-18
Author: betatim@gmail.com
File Name: skopt/utils.py
Class Name:
Method Name: normalize_dimensions


Project Name: pysb/pysb
Commit Name: eab2da81c65974e08b8245bbf8a052093f972df3
Time: 2009-08-09
Author: jmuhlich@bitflood.org
File Name: Pysb.py
Class Name: Rule
Method Name: __init__


Project Name: scikit-optimize/scikit-optimize
Commit Name: 7bd676c9ab6b23ec93499fd72aeadee3a334a163
Time: 2017-08-18
Author: betatim@gmail.com
File Name: skopt/utils.py
Class Name:
Method Name: normalize_dimensions


Project Name: danforthcenter/plantcv
Commit Name: b32e4498c65bc3ca913fca9f729bc1d43d12d884
Time: 2019-03-15
Author: haleyschuhl@gmail.com
File Name: plantcv/plantcv/visualize/colorize_masks.py
Class Name:
Method Name: colorize_masks