Class ReplaceNaNWithRandomFilter

  • All Implemented Interfaces:
    elki.datasource.bundle.BundleStreamSource, elki.datasource.filter.ObjectFilter, elki.datasource.filter.StreamFilter

    public class ReplaceNaNWithRandomFilter
    extends AbstractStreamFilter
    A filter to replace all NaN values with random values.

    Note: currently, only dense vector columns are supported.

    TODO: add support for sparse vectors.

    Since:
    0.6.0
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ReplaceNaNWithRandomFilter.Par
      Parameterization class.
      • Nested classes/interfaces inherited from interface elki.datasource.bundle.BundleStreamSource

        elki.datasource.bundle.BundleStreamSource.Event
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private elki.data.NumberVector.Factory<?>[] densecols
      Columns to check.
      private elki.math.statistics.distribution.Distribution dist
      Distribution to generate replacement values with.
      private static elki.logging.Logging LOG
      Class logger
      private java.util.Random rnd
      Random generator.
      private java.util.ArrayList<java.lang.Object> rows
      Row cache.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReplaceNaNWithRandomFilter​(elki.math.statistics.distribution.Distribution dist, elki.utilities.random.RandomFactory rnd)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object data​(int rnum)  
      elki.datasource.bundle.MultipleObjectsBundle filter​(elki.datasource.bundle.MultipleObjectsBundle objects)  
      elki.datasource.bundle.BundleMeta getMeta()  
      elki.datasource.bundle.BundleStreamSource.Event nextEvent()  
      private void updateMeta​(elki.datasource.bundle.BundleMeta meta)
      Process an updated meta record.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • LOG

        private static final elki.logging.Logging LOG
        Class logger
      • densecols

        private elki.data.NumberVector.Factory<?>[] densecols
        Columns to check.
      • dist

        private elki.math.statistics.distribution.Distribution dist
        Distribution to generate replacement values with.
      • rows

        private java.util.ArrayList<java.lang.Object> rows
        Row cache.
      • rnd

        private java.util.Random rnd
        Random generator.
    • Constructor Detail

      • ReplaceNaNWithRandomFilter

        public ReplaceNaNWithRandomFilter​(elki.math.statistics.distribution.Distribution dist,
                                          elki.utilities.random.RandomFactory rnd)
        Constructor.
        Parameters:
        dist - Distribution to draw from
        rnd - Random generator
    • Method Detail

      • getMeta

        public elki.datasource.bundle.BundleMeta getMeta()
      • data

        public java.lang.Object data​(int rnum)
      • nextEvent

        public elki.datasource.bundle.BundleStreamSource.Event nextEvent()
      • updateMeta

        private void updateMeta​(elki.datasource.bundle.BundleMeta meta)
        Process an updated meta record.
        Parameters:
        meta - Meta record
      • filter

        public elki.datasource.bundle.MultipleObjectsBundle filter​(elki.datasource.bundle.MultipleObjectsBundle objects)
        Specified by:
        filter in interface elki.datasource.filter.ObjectFilter
        Overrides:
        filter in class AbstractStreamFilter