Encog.Util.CSV.ReadCSV.HasMissing C# (CSharp) Method

HasMissing() public method

Check to see if there are any missing values on the current row.
public HasMissing ( ) : bool
return bool
        public bool HasMissing()
        {
            for (int i = 0; i < _data.Length; i++)
            {
                String s = _data[i].Trim();
                if (s.Length == 0 || s.Equals("?"))
                {
                    return true;
                }
            }
            return false;
        }
    }

Usage Example

        /// <summary>
        /// Analyze the file.
        /// </summary>
        private void AnalyzeFile()
        {
            ScriptProperties prop = _analyst.Script.Properties;

            // get filenames, headers & format
            String sourceID = prop.GetPropertyString(
                ScriptProperties.HeaderDatasourceRawFile);

            FileInfo sourceFile = _analyst.Script.ResolveFilename(sourceID);
            CSVFormat format = _analyst.Script.DetermineFormat();
            bool headers = _analyst.Script.ExpectInputHeaders(sourceID);

            // read the file
            _rowCount = 0;
            _missingCount = 0;

            var csv = new ReadCSV(sourceFile.ToString(), headers, format);
            while (csv.Next())
            {
                _rowCount++;
                if (csv.HasMissing())
                {
                    _missingCount++;
                }
            }
            csv.Close();
        }
All Usage Examples Of Encog.Util.CSV.ReadCSV::HasMissing