paddy.PaddyParameter module

The paddy.Paddy_Parameter module contains the PaddyParameter class and its associated methods.

The PaddyParameter class is used to manage the generation of numeric values associated with parameters that are being optomized paddy. Specific operations are detailed in the methods section of PaddyParameter.

Routine Listings

PaddyParameter(object)

Stores information regarding a parameter being optimized, and handles operations on associated values.

See Also

paddy.Paddy_Runner

class paddy.Paddy_Parameter.PaddyParameter(param_range, param_type, limits, gaussian, normalization)[source]

Bases: object

The class that handles operations and atributes used for generating random and new seed parameters.

Parameters
param_rangelist of integer or float

A list of three numeric values used to define what random seed value is possible for the specific PaddyParameter where the first position (a) is the lowest possible value, the second position (b) is the highest possible value, and the third position (c) is the incremental unit used to develop a range between a & b to generate a random value in said range.

param_typestring

A string that, unless using a custom class in place of PaddyParameter, should be either: ‘integer’ or ‘continuous’. This allows the algorithm to either pass integer or float class instances.

limitsNone or list of integer or float

A list of two values used to define if a new seed’s respective parameter value is permitted. Additionally, these values are used to normalize values if the normalization argument is set as True. The fist value in the limits list is the minimum value, and the second value is the maximum value permitted as defined by user. If None is used in the list, possible values are unbound in that direction. If a unbound limit term exists, normalization is defined as False internally, overriding a user input.

gaussianstring

A string that, unless using a custom class in place of PaddyParameter, should be either: ‘default’ or ‘scaled’. This allows the algorithm to determine if scaling of the standard deviation, used by the gaussian distribution that new paddy parameter values are generated along, is desired by the user.

normalizationbool

A boolean to determine if min-max normalization is used when using the methods random_init, new_seed_init, and get_ecludian_values. The minimum and maximum values for normalization are defined by the limits argument, and cannont contain inf for normalization to be True. If limits is None normalization again must be False.

Raises
PaddyParamError

If parameter value(s) used to initialize an instance of PaddyParameter would raise an exception when calling methods of PaddyParameter.

Methods

random_init()

Generates random new values defined by param_range.

new_seed_init(values)

Generates new values for the parameter and gaussian.

norm_p(p_val)

Normalizes a seed parameter.

inverse_norm_p(ip_val)

Returns a denormalized seed parameter.

get_ecludian_values(p_vals)

Returns apropriate value for euclidean evaluation.

__init__(self, param_range, param_type, limits, gaussian, normalization)[source]

Initialize self. See help(type(self)) for accurate signature.

__weakref__

list of weak references to the object (if defined)

get_ecludian_values(self, p_vals)[source]

Return the ecludian value for a paddy parameter.

This allows normalization of a parameter to be considered during neighbor counting, prior to returning the apropriate ecludian value.

Parameters
p_valslist, shape (2)
Returns
e_valinteger, float

A numeric value that is used during neighbor counting.

See also

paddy.PaddyRunner.neighbor_counter()
inverse_norm_p(self, ip_val)[source]

Inverses min-max feature scaling.

See also

norm_p()
new_seed_init(self, values)[source]

Return values for a new seed.

Takes values from previous seed and generates seeds for a new paddy iteration.

Parameters
valueslist, shape (2)
Returns
blist, shape (2)

A list containing the numeric values for the parameter and associated gaussian of a new seed.

See also

paddy.PaddyRunner.new_propogation()
norm_p(self, p_val)[source]

Return normalized paddy value via min-max feature scaling.

Parameters
p_valinteger or float

Single seed parameter value from previous itteration.

Returns
np_valinteger or float

Normalized parameter value used to generate a new seed or undergo euclidean evaluation.

random_init(self)[source]

Generates and returns random value for seeds.

This is used to generate random values during the random propogation step when initializing the paddy algorithm. The param_range parameter of PaddyParameter is used to define a range of posible values from which the new seed uses during evaluation.

Returns
valueinteger or float

New numeric value for a parameter evaluated by paddy.

See also

paddy.PaddyRunner.random_step()