Class SandboxMLCache


  • public class SandboxMLCache
    extends java.lang.Object
    Common utility code used in some ML examples to set up test cache.
    • Constructor Detail

      • SandboxMLCache

        public SandboxMLCache​(Ignite ignite)
    • Method Detail

      • fillCacheWith

        public IgniteCache<java.lang.Integer,​double[]> fillCacheWith​(double[][] data)
        Fills cache with data and returns it.
        Parameters:
        data - Data to fill the cache with.
        Returns:
        Filled Ignite Cache.
      • loadDataset

        public java.util.List<java.lang.String> loadDataset​(MLSandboxDatasets dataset)
                                                     throws java.io.IOException
        Loads dataset as a list of rows.
        Parameters:
        dataset - The chosen dataset.
        Returns:
        List of rows.
        Throws:
        java.io.IOException - If file not found.
      • fillCacheWith

        public IgniteCache<java.lang.Integer,​Vector> fillCacheWith​(MLSandboxDatasets dataset)
                                                                  throws java.io.FileNotFoundException
        Fills cache with data and returns it.
        Parameters:
        dataset - The chosen dataset.
        Returns:
        Filled Ignite Cache.
        Throws:
        java.io.FileNotFoundException - If file not found.
      • fillObjectCacheWithDoubleLabels

        public IgniteCache<java.lang.Integer,​java.lang.Object[]> fillObjectCacheWithDoubleLabels​(MLSandboxDatasets dataset)
                                                                                                throws java.io.FileNotFoundException
        Fills cache with data and returns it.
        Parameters:
        dataset - The chosen dataset.
        Returns:
        Filled Ignite Cache.
        Throws:
        java.io.FileNotFoundException - If file not found.
      • fillObjectCacheWithCategoricalData

        public IgniteCache<java.lang.Integer,​java.lang.Object[]> fillObjectCacheWithCategoricalData​(MLSandboxDatasets dataset)
                                                                                                   throws java.io.FileNotFoundException
        Fills cache with data and returns it.
        Parameters:
        dataset - The chosen dataset.
        Returns:
        Filled Ignite Cache.
        Throws:
        java.io.FileNotFoundException - If file not found.