nenok.va
Interface Predictability

All Superinterfaces:
Cloneable, Serializable, Valuation
All Known Implementing Classes:
RegularSRValuation, ScaledSRValuation, SRValuation

public interface Predictability
extends Valuation

This interface makes a valuation algebra weight predictable. Weight predictors only depend on the domain of a valuation and not on the valuation object itself. One must be able to call the weight predictor, even if no corresponding valuation exists. This actually demands a static implementation. On the other hand, each valuation algebra possesses its own weight predictor, which makes the static design approach impossible.

The workaround presented here is simple. We create weight predictors as an external object and this class simply returns such an object that effectively computes the weight. Doing so, we advise the weight function in the Valuation interface as follows: public int weight() { return predictor().predict(this.label()); }

Version:
1.1
Author:
Marc Pouly

Method Summary
 Predictor predictor()
           
 
Methods inherited from interface nenok.va.Valuation
combine, label, marginalize, weight
 

Method Detail

predictor

Predictor predictor()
Returns:
A predictor instance corresponding to this valuation algebra.