Class LWLDatasetBuilder

    • Field Detail

      • m_Train

        protected weka.core.Instances m_Train
        The training instances used for classification.
      • m_ActualTrain

        protected transient weka.core.Instances m_ActualTrain
        The actual training instances used for classification.
      • m_kNN

        protected int m_kNN
        The number of neighbours used to select the kernel bandwidth.
      • m_WeightKernel

        protected int m_WeightKernel
        The weighting kernel method currently selected.
      • m_UseAllK

        protected boolean m_UseAllK
        True if m_kNN should be set to all instances.
      • m_Search

        protected weka.core.neighboursearch.NearestNeighbourSearch m_Search
        The nearest neighbour search algorithm to use.
      • m_ActualSearch

        protected transient weka.core.neighboursearch.NearestNeighbourSearch m_ActualSearch
        The actual nearest neighbour search algorithm to use.
      • m_NoUpdate

        protected boolean m_NoUpdate
        whether to suppress the update of the nearest-neighbor search algorithm when making predictions.
      • m_AddID

        protected transient weka.filters.unsupervised.attribute.AddID m_AddID
        for adding the ID to trace the instances.
    • Constructor Detail

      • LWLDatasetBuilder

        public LWLDatasetBuilder()
    • Method Detail

      • reset

        protected void reset()
        Resets the scheme.
      • setKNN

        public void setKNN​(int value)
        Sets the number of neighbours used for kernel bandwidth setting. The bandwidth is taken as the distance to the kth neighbour.
        Parameters:
        value - the number of neighbours included inside the kernel bandwidth, or 0 to specify using all neighbors.
      • getKNN

        public int getKNN()
        Gets the number of neighbours used for kernel bandwidth setting. The bandwidth is taken as the distance to the kth neighbour.
        Returns:
        the number of neighbours included inside the kernel bandwidth, or 0 for all neighbours
      • setWeightingKernel

        public void setWeightingKernel​(int value)
        Sets the kernel weighting method to use. Must be one of LINEAR, EPANECHNIKOV, TRICUBE, INVERSE, GAUSS or CONSTANT, other values are ignored.
        Parameters:
        value - the new kernel method to use. Must be one of LINEAR, EPANECHNIKOV, TRICUBE, INVERSE, GAUSS or CONSTANT.
      • getWeightingKernel

        public int getWeightingKernel()
        Gets the kernel weighting method to use.
        Returns:
        the new kernel method to use. Will be one of LINEAR, EPANECHNIKOV, TRICUBE, INVERSE, GAUSS or CONSTANT.
      • setSearchAlgorithm

        public void setSearchAlgorithm​(weka.core.neighboursearch.NearestNeighbourSearch value)
        Sets the nearestNeighbourSearch algorithm to be used for finding nearest neighbour(s).
        Parameters:
        value - - The NearestNeighbourSearch class.
      • getSearchAlgorithm

        public weka.core.neighboursearch.NearestNeighbourSearch getSearchAlgorithm()
        Returns the current nearestNeighbourSearch algorithm in use.
        Returns:
        the NearestNeighbourSearch algorithm currently in use.
      • setNoUpdate

        public void setNoUpdate​(boolean value)
        Sets whether to suppress updating the nearest-neighbor search algorithm when making predictions.
        Parameters:
        value - if true then no update happens.
      • getNoUpdate

        public boolean getNoUpdate()
        Returns whether to suppress the update of the nearest-neighbor search algorithm when making predictions.
        Returns:
        true if the update is suppressed
      • setTrain

        public void setTrain​(weka.core.Instances value)
        Sets the training data to use.
        Parameters:
        value - the data
      • getTrain

        public weka.core.Instances getTrain()
        Returns the training data in use.
        Returns:
        the data
      • getIDAttributeName

        protected String getIDAttributeName​(weka.core.Instances data)
        Returns a unique attribute name for the ID attribute.
        Parameters:
        data - the data to insert the attribute
        Returns:
        the attribute name
      • build

        public LWLDatasetBuilder.LWLContainer build​(weka.core.Instance instance)
                                             throws Exception
        Constructs the weighted dataset.
        Parameters:
        instance - the instance to make prediction for
        Returns:
        the container with the generated for the classifier to train with
        Throws:
        Exception - if build fails
      • toString

        public String toString()
        Returns a short string description of the setup.
        Overrides:
        toString in class Object
        Returns:
        the description