Class HSTrees

    • Field Detail

      • windowSizeOption

        public IntOption windowSizeOption
      • numTreesOption

        public IntOption numTreesOption
      • maxDepthOption

        public IntOption maxDepthOption
      • anomalyThresholdOption

        public FloatOption anomalyThresholdOption
    • Constructor Detail

      • HSTrees

        public HSTrees()
    • Method Detail

      • trainOnInstanceImpl

        public void trainOnInstanceImpl​(Instance inst)
        Update the forest with the argument instance
        Specified by:
        trainOnInstanceImpl in class AbstractClassifier
        Parameters:
        inst - the instance to pass to the forest
      • getVotesForInstance

        public double[] getVotesForInstance​(Instance inst)
        Combine the anomaly scores from each HSTree in the forest and convert into a vote score.
        Specified by:
        getVotesForInstance in interface Classifier
        Specified by:
        getVotesForInstance in class AbstractClassifier
        Parameters:
        inst - the instance to get votes for
        Returns:
        the votes for the instance's label [normal, outlier]
      • getAnomalyScore

        public double getAnomalyScore​(Instance inst)
        Returns the anomaly score for the argument instance.
        Specified by:
        getAnomalyScore in interface OneClassClassifier
        Parameters:
        inst - the argument instance
        Returns:
        inst's anomaly score
      • isRandomizable

        public boolean isRandomizable()
        HSTrees is randomizable.
        Specified by:
        isRandomizable in interface Learner<Example<Instance>>
        Returns:
        true if the learner needs a random seed.
      • getModelMeasurementsImpl

        protected Measurement[] getModelMeasurementsImpl()
        Description copied from class: AbstractClassifier
        Gets the current measurements of this classifier.

        The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
        Specified by:
        getModelMeasurementsImpl in class AbstractClassifier
        Returns:
        an array of measurements to be used in evaluation tasks
      • getModelDescription

        public void getModelDescription​(StringBuilder out,
                                        int indent)
        Description copied from class: AbstractClassifier
        Returns a string representation of the model.
        Specified by:
        getModelDescription in class AbstractClassifier
        Parameters:
        out - the stringbuilder to add the description
        indent - the number of characters to indent
      • initialize

        public void initialize​(Collection<Instance> trainingPoints)
        Initializes the Streaming HS-Trees classifier on the argument trainingPoints.
        Specified by:
        initialize in interface OneClassClassifier
        Parameters:
        trainingPoints - the Collection of instance with which to initialize the Streaming Hs-Trees classifier.