Class RelevancyModel

    • Constructor Detail

      • RelevancyModel

        public RelevancyModel()
      • RelevancyModel

        public RelevancyModel​(java.lang.String name)
      • RelevancyModel

        public RelevancyModel​(java.lang.String name,
                              long version)
    • Method Detail

      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String value)
      • getVersion

        public long getVersion()
      • setVersion

        public void setVersion​(long value)
      • getLastModified

        public long getLastModified()
        Get the timestamp for the last modification to this relevancy model
      • setLastModified

        public void setLastModified​(long value)
        Get the timestamp for the last modification to this relevancy model
      • getQueryString

        public java.lang.String getQueryString()
        Get a query string for explicitly selecting this relevancy model.
      • getAccuracy

        public double getAccuracy()
        Get the computed accuracy for a trained relevancy model.

        Accuracy score will range between 0.0 and 100.0, indicating a percentage score.

        Accuracy will only be populated for RelevancyModel.Source.TRAINED relevancy models and will be computed over the signal data used to train the model.

      • setAccuracy

        public void setAccuracy​(double value)
        Set the computed accuracy for a trained relevancy model.

        Accuracy score will range between 0.0 and 100.0, indicating a percentage score.

        Accuracy will only be populated for RelevancyModel.Source.TRAINED relevancy models and will be computed over the signal data used to train the model.

      • getPublishThreshold

        public double getPublishThreshold()
        Get the accuracy threshold needed to be achieved to automatically publish a trained relevancy model.

        If this threshold is > 0.0 and the computed accuracy for the relevancy model is greater than this threshold, the relevancy model will be automatically published as part of training.

        NOTE: only applies when relevancy model is being trained.

      • setPublishThreshold

        public void setPublishThreshold​(double value)
        Set the accuracy threshold needed to be achieved to automatically publish a trained relevancy model.

        If this threshold is > 0.0 and the computed accuracy for the relevancy model is greater than this threshold, the relevancy model will be automatically published as part of training.

        NOTE: only applies when relevancy model is being trained.

      • getMaxHistory

        public int getMaxHistory()
        Get the maximum number of trained relevancy models to retain.

        If greater than zero, upon successful training of this relevancy model, old trained relevancy models that are not published will be purged.

      • setMaxHistory

        public void setMaxHistory​(int value)
        Set the maximum number of trained relevancy models to retain.

        If greater than zero, upon successful training of this relevancy model, old trained relevancy models that are not published will be purged.

      • getMaxSignalAge

        public long getMaxSignalAge()
        Get maximum age for a signal to include when training relevancy model (in milliseconds).

        If less than 1, signals will be included in training data regardless of age.

      • setMaxSignalAge

        public void setMaxSignalAge​(long value)
        Set maximum age for a signal to include when training relevancy model (in milliseconds).

        If less than 1, signals will be included in training data regardless of age.

      • getSignalTypes

        public java.util.Set<java.lang.String> getSignalTypes()
        Get the signal types to use when training relevancy model.

        If null all signal types will be included in training data.

      • setSignalTypes

        public void setSignalTypes​(java.util.Set<java.lang.String> value)
        Set the signal types to use when training relevancy model.

        If null all signal types will be included in training data.

      • setSignalTypes

        public void setSignalTypes​(java.lang.String... value)
      • getFeatureWhitelist

        public java.util.Set<java.lang.String> getFeatureWhitelist()
        Get the names of the features to use for training relevancy model.

        If null all available features not in getFeatureBlacklist() will be included in training data.

      • setFeatureWhitelist

        public void setFeatureWhitelist​(java.util.Set<java.lang.String> value)
        Set the names of the features to use for training relevancy model.

        If no features are specified, all available features not in getFeatureBlacklist() will be included in training data.

      • setFeatureWhitelist

        public void setFeatureWhitelist​(java.lang.String... value)
        Set the names of the features to use for training relevancy model.

        If no features are specified, all available features not in getFeatureBlacklist() will be included in training data.

      • getFeatureBlacklist

        public java.util.Set<java.lang.String> getFeatureBlacklist()
        Get the names of the features to exclude from relevancy model training data.
      • setFeatureBlacklist

        public void setFeatureBlacklist​(java.util.Set<java.lang.String> value)
        Set the names of the features to exclude from relevancy model training data.
      • setFeatureBlacklist

        public void setFeatureBlacklist​(java.lang.String... value)
        Set the names of the features to exclude from relevancy model training data.
      • getOption

        public java.lang.String getOption​(java.lang.String name)
        Get an option by name.

        Options are advanced arbitrary key/value pairs used for tuning the training of relevancy models.

      • setOption

        public void setOption​(java.lang.String name,
                              java.lang.String value)
      • getOptions

        public java.util.Map<java.lang.String,​java.lang.String> getOptions()
        Get options to use for training relevancy model.

        Options are advanced arbitrary key/value pairs used for tuning the training of relevancy models.

      • setOptions

        public void setOptions​(java.util.Map<java.lang.String,​java.lang.String> value)
        Set options to use for training relevancy model.

        Options are advanced arbitrary key/value pairs used for tuning the training of relevancy models.

      • addWeight

        public void addWeight​(java.lang.String feature,
                              float weight)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clone

        public RelevancyModel clone()
        Overrides:
        clone in class java.lang.Object
      • isBaseName

        public static boolean isBaseName​(java.lang.String query)
        Returns true if query is a base relevancy model name.

        Returns false if query contains a version specification.

      • getBaseName

        public static java.lang.String getBaseName​(java.lang.String query)
        Get the relevancy model name for a query.
      • getVersion

        public static long getVersion​(java.lang.String query)
        Get the version for a relevancy model query.
      • getQueryString

        public static java.lang.String getQueryString​(java.lang.String name,
                                                      long version)
        Get a query string for explicitly selecting this relevancy model.
      • parseRelevancyModelNames

        public static java.util.List<java.lang.String> parseRelevancyModelNames​(java.lang.String value)
        Parse a comma separated list of relevancy model names.