OEFPVariogram

class OEFPVariogram : public OEFPHistogram

OEFPVariogram class is used to generate a variogram of similarity scores and related empirical measurements. An OEFPVariogram object is a OEFPHistogram with additional variogram data regarding user provided measurements.

The empirical variogram has the form :

\(\hat{\gamma}(h)=\frac{1}{2|N(h)|}\sum\limits_{(i,j)\in N(h)} |z_i-z_j|^2\)

Where \(N(h)\) is the set of pairs that have a distance close to \(h\) and \(z_i\) is the measurement provided for the \(i\) th molecule.

For all of our built-in similarity measures, except for Tversky, distance is calculated a \(1-similarity\). It is not possible to calculate an empirical variogram using Tversky similarity.

The measurement in the context of a variogram can be any user provided value per fingerprint e.g. bioassay data or calculated properties.

The following methods are publicly inherited from OEFPHistogram:

AddSample

GetCounts

NumBins

GetBinBoundaries

GetDensity

NumSamples

GetBinCenters

GetMax

Std

GetBinIdx

GetMin

GetBinWidth

Mean

Constructors

OEFPVariogram(numBins: int = 200, min: float = 0.0,
              max: float = 1.0) -> OEFPVariogram
OEFPVariogram(arg2: OEFPVariogram) -> OEFPVariogram

Creates an OEFPVariogram object with the given number of bins and similarity range.

numBins

Number of bins in the histogram. (default = 200)

min

Minimum bound (inclusive) of the similarity range. (default = 0.0)

max

Maximum bound (inclusive) of the similarity range. (default = 1.0)

AddSample

AddSample(sim: float, obs: float) -> int

Adds a sample representing a pair of molecules into the variogram

sim

Similarity between fingerprints i and j

obs

Measured difference between the relevant fingerprints \(z_i-z_j\)

Note

Since we are dealing with \(|z_i-z_j|^2\) this relationship is actually symmetrical.

GetVariogram

GetVariogram() -> Iterable[float]

Returns an iterator over the empirical variogram.