Class MDMetricOptimizer


  • @PublicAPI
    public class MDMetricOptimizer
    extends Object

    Optimization of metric parameters for dissimilarity based screening. Parameter optimization is uniform for each metric: it is based on the optimization of the performance of the metrics when used for screening molecules. Optimization is performed defining the parameters as variables, its goal is to maximize the selected evaluator function of the given MDHitEvaluator object during screening performed on a test set. The test set consists of actives (similar set) mixed with molecules randomly selected from the target set of screening (dissimilar set).

    Parameters are written into the common MDParameters object, determined from the query descriptors.

    The MDHitEvaluator object must be set up, for its usage see MDHitEvaluator. Parametrized metrics must be set (weighted, asymmetric, scaled, etc.) MDReaders also must be set up, for usage see MDReader.

    Typical usage:

     MDMetricOptimizer metrOpt = new MDMetricOPtimizer( evaluator );
     metrOpt.optimizeParameters( pfp2DIndex, euclideanIndex, similarReader, dissimilarReader );
     
    Since:
    JChem 2.0
    • Field Detail

      • nrOfIterations

        public int nrOfIterations
        Maximal allowed number of iterations
      • maxErrorInF

        public float maxErrorInF
        Maximal allowed difference in last two calculated values of the enrichment ratio function for termination.
      • maxErrorInX

        public float maxErrorInX
        Maximal allowed dofference in last two calculated values of the weight variables for termination.
      • percentage

        public float percentage
        Consider enrichment ratio values only in cases, when at least the given percent of similars is selected as hits.
    • Constructor Detail

      • MDMetricOptimizer

        public MDMetricOptimizer​(MDHitEvaluator evaluator)
        Constructor of parameter optimizer.
        Parameters:
        evaluator - Evaluator of acive/inactive hits
    • Method Detail

      • optimizeParameters

        public void optimizeParameters​(int mdIndex,
                                       int metricIndex,
                                       MDReader similarSet,
                                       MDReader dissimilarSet)
                                throws MDReaderException
        Finds optimal parameter values for the given metric. Parameters are set and can be withdrawn from the common MDParameters object.
        Parameters:
        mdIndex - Index of molecular descriptor
        metricIndex - Index of metric
        similarSet - Reader of the set containing actives to be selected as hits
        dissimilarSet - Reader of target fingerprints
        Throws:
        MDReaderException - if the reader encounter a read error