gnes.score_fn.base module¶

class gnes.score_fn.base.BaseScoreFn(context=None, *args, **kwargs)[source]¶

Bases: gnes.base.TrainableBase

Base score function. A score function must implement __call__ method

new_score(*, operands=(), **kwargs)[source]¶
train(*args, **kwargs)¶

Train the model, need to be overrided

warn_unnamed = False¶
class gnes.score_fn.base.CombinedScoreFn(score_mode='multiply', *args, **kwargs)[source]¶

Bases: gnes.score_fn.base.BaseScoreFn

Combine multiple scores into one score, defaults to ‘multiply’

Parameters:score_mode (str) – specifies how the computed scores are combined
post_init()[source]¶

Declare class attributes/members that can not be serialized in standard way

supported_ops¶
train(*args, **kwargs)¶

Train the model, need to be overrided

class gnes.score_fn.base.ModifierScoreFn(modifier='none', factor=1.0, factor_name='GivenConstant', *args, **kwargs)[source]¶

Bases: gnes.score_fn.base.BaseScoreFn

Modifier to apply to the value score = modifier(factor * value)

post_init()[source]¶

Declare class attributes/members that can not be serialized in standard way

supported_ops¶
train(*args, **kwargs)¶

Train the model, need to be overrided

class gnes.score_fn.base.ScoreOps[source]¶

Bases: object

abs = <gnes.score_fn.base.ModifierScoreFn object>¶
avg = <gnes.score_fn.base.CombinedScoreFn object>¶
ln = <gnes.score_fn.base.ModifierScoreFn object>¶
ln1p = <gnes.score_fn.base.ModifierScoreFn object>¶
ln2p = <gnes.score_fn.base.ModifierScoreFn object>¶
log = <gnes.score_fn.base.ModifierScoreFn object>¶
log1p = <gnes.score_fn.base.ModifierScoreFn object>¶
log2p = <gnes.score_fn.base.ModifierScoreFn object>¶
max = <gnes.score_fn.base.CombinedScoreFn object>¶
min = <gnes.score_fn.base.CombinedScoreFn object>¶
multiply = <gnes.score_fn.base.CombinedScoreFn object>¶
none = <gnes.score_fn.base.ModifierScoreFn object>¶
reciprocal = <gnes.score_fn.base.ModifierScoreFn object>¶
reciprocal1p = <gnes.score_fn.base.ModifierScoreFn object>¶
sqrt = <gnes.score_fn.base.ModifierScoreFn object>¶
square = <gnes.score_fn.base.ModifierScoreFn object>¶
sum = <gnes.score_fn.base.CombinedScoreFn object>¶
gnes.score_fn.base.get_unary_score(value, **kwargs)[source]¶