Mapper

Mapper module hold base implementation for mappers. Mappers are functions that map feature’s possible values to the interval [-1, 1]. While features are thought to belong to artifacts of certain types, mappers usually belong to a single agent making it possible for each agent to have their own appreciation standards for the feature.

class creamas.rules.mapper.Mapper[source]

Base implementation of mapper, serves as identity function for int and float types.

Mappers, as rules and features, are callable after initialization.

map(value)[source]

Map given value to the interval [-1, 1].

This base implementation maps each value to itself, capping to [-1, 1].

Parameters

value – Value to map

Returns

Value mapped to the interval [-1, 1]

Rtype float

property value_set

Acceptable input types for the mapper.