Esempio n. 1
0
 /// <summary>
 /// Load CSV to memory.
 /// </summary>
 /// <param name="filename">The CSV file to load.</param>
 /// <param name="input">The input count.</param>
 /// <param name="ideal">The ideal count.</param>
 /// <param name="headers">True, if headers are present.</param>
 /// <param name="format">The loaded dataset.</param>
 /// <param name="expectSignificance">The loaded dataset.</param>
 /// <returns></returns>
 public static IMLDataSet LoadCSV2Memory(String filename, int input, int ideal, bool headers, CSVFormat format, bool expectSignificance)
 {
     IDataSetCODEC codec = new CSVDataCODEC(filename, format, headers, input, ideal, expectSignificance);
     var load = new MemoryDataLoader(codec);
     IMLDataSet dataset = load.External2Memory();
     return dataset;
 }
Esempio n. 2
0
        /// <summary>
        /// Create a SQL neural data set.
        /// </summary>
        /// <param name="sql">The SQL to execute.</param>
        /// <param name="inputSize">The size of the input data being read.</param>
        /// <param name="idealSize">The size of the ideal output data being read.</param>
        /// <param name="connectString">The connection string.</param>
        public SQLMLDataSet(String sql, int inputSize,
                            int idealSize, String connectString)
        {
            IDataSetCODEC codec = new SQLCODEC(sql, inputSize, idealSize, connectString);
            var           load  = new MemoryDataLoader(codec)
            {
                Result = this
            };

            load.External2Memory();
        }
        /// <summary>
        /// Construct this data set using a comma as a delimiter.
        /// </summary>
        /// <param name="filename">The CSV filename to read.</param>
        /// <param name="inputSize">The number of columns that make up the input set.</param>
        /// <param name="idealSize">The number of columns that make up the ideal set.</param>
        /// <param name="headers">True if headers are present on the first line.</param>
        /// <param name="format">The format to use.</param>
        public CSVMLDataSet(String filename, int inputSize,
                            int idealSize, bool headers, CSVFormat format, bool expectSignificance)
        {
            _filename  = filename;
            _inputSize = inputSize;
            _idealSize = idealSize;
            _format    = format;
            _headers   = headers;

            IDataSetCODEC codec = new CSVDataCODEC(filename, format, headers, inputSize, idealSize, expectSignificance);
            var           load  = new MemoryDataLoader(codec)
            {
                Result = this
            };

            load.External2Memory();
        }