当前位置: 首页>>代码示例>>C#>>正文


C# EncogAnalyst类代码示例

本文整理汇总了C#中EncogAnalyst的典型用法代码示例。如果您正苦于以下问题:C# EncogAnalyst类的具体用法?C# EncogAnalyst怎么用?C# EncogAnalyst使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EncogAnalyst类属于命名空间,在下文中一共展示了EncogAnalyst类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Analyze

        /// <summary>
        ///     Analyze the data. This counts the records and prepares the data to be
        ///     processed.
        /// </summary>
        /// <param name="theAnalyst">The analyst to use.</param>
        /// <param name="inputFile">The input file.</param>
        /// <param name="headers">True if headers are present.</param>
        /// <param name="format">The format the file is in.</param>
        public void Analyze(EncogAnalyst theAnalyst,
                            FileInfo inputFile, bool headers, CSVFormat format)
        {
            InputFilename = inputFile;
            ExpectInputHeaders = headers;
            Format = format;
            _analyst = theAnalyst;

            Analyzed = true;

            PerformBasicCounts();

            _inputCount = _analyst.DetermineInputCount();
            _outputCount = _analyst.DetermineOutputCount();
            _idealCount = InputHeadings.Length - _inputCount;

            if ((InputHeadings.Length != _inputCount)
                && (InputHeadings.Length != (_inputCount + _outputCount)))
            {
                throw new AnalystError("Invalid number of columns("
                                       + InputHeadings.Length + "), must match input("
                                       + _inputCount + ") count or input+output("
                                       + (_inputCount + _outputCount) + ") count.");
            }
        }
开发者ID:jongh0,项目名称:MTree,代码行数:33,代码来源:AnalystEvaluateRawCSV.cs

示例2: AnalystProcess

        /// <summary>
        ///     Construct the object.
        /// </summary>
        /// <param name="theAnalyst">The analyst.</param>
        /// <param name="theBackwardWindowSize">The backward window size.</param>
        /// <param name="theForwardWindowSize">The forward window size.</param>
        public AnalystProcess(EncogAnalyst theAnalyst, int theBackwardWindowSize, int theForwardWindowSize)
        {
            analyst = theAnalyst;

            backwardWindowSize = theBackwardWindowSize;
            forwardWindowSize = theForwardWindowSize;
            StandardExtensions.CreateAll(programContext);
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:14,代码来源:AnalystProcess.cs

示例3: HandleMissing

 /// <inheritdoc/>
 public double[] HandleMissing(EncogAnalyst analyst, AnalystField stat)
 {
     var result = new double[stat.ColumnsNeeded];
     double n = stat.NormalizedHigh - (stat.NormalizedHigh - stat.NormalizedLow/2);
     for (int i = 0; i < result.Length; i++)
     {
         result[i] = n;
     }
     return result;
 }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:11,代码来源:NegateMissing.cs

示例4: HandleMissing

 /// <inheritdoc/>
 public double[] HandleMissing(EncogAnalyst analyst, AnalystField stat)
 {
     // mode?
     if (stat.Classify)
     {
         var m = stat.DetermineMode(analyst);
         return stat.Encode(m);
     }
     // mean
     var df = analyst.Script.FindDataField(stat.Name);
     var result = new double[1];
     result[0] = df.Mean;
     return result;
 }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:15,代码来源:MeanAndModeMissing.cs

示例5: Analyze

        /// <summary>
        /// Analyze the data. This counts the records and prepares the data to be
        /// processed.
        /// </summary>
        ///
        /// <param name="theAnalyst">The analyst to use.</param>
        /// <param name="inputFile">The input file to analyze.</param>
        /// <param name="headers">True, if the input file has headers.</param>
        /// <param name="format">The format of the input file.</param>
        public void Analyze(EncogAnalyst theAnalyst,
                            FileInfo inputFile, bool headers, CSVFormat format)
        {
            InputFilename = inputFile;
            ExpectInputHeaders = headers;
            InputFormat = format;

            Analyzed = true;
            _analyst = theAnalyst;

            if (OutputFormat == null)
            {
                OutputFormat = InputFormat;
            }

            _data = new BasicMLDataSet();
            ResetStatus();
            int recordCount = 0;

            int outputLength = _analyst.DetermineTotalColumns();
            var csv = new ReadCSV(InputFilename.ToString(),
                                  ExpectInputHeaders, InputFormat);
            ReadHeaders(csv);

            _analystHeaders = new CSVHeaders(InputHeadings);

            while (csv.Next() && !ShouldStop())
            {
                UpdateStatus(true);

                var row = new LoadedRow(csv, 1);

                double[] inputArray = AnalystNormalizeCSV.ExtractFields(
                    _analyst, _analystHeaders, csv, outputLength, true);
                var input = new ClusterRow(inputArray, row);
                _data.Add(input);

                recordCount++;
            }
            RecordCount = recordCount;
            Count = csv.ColumnCount;

            ReadHeaders(csv);
            csv.Close();
            ReportDone(true);
        }
开发者ID:encog,项目名称:encog-silverlight-core,代码行数:55,代码来源:AnalystClusterCSV.cs

示例6: Analyze

        /// <summary>
        /// Analyze the data. This counts the records and prepares the data to be
        /// processed.
        /// </summary>
        ///
        /// <param name="theAnalyst">The analyst to use.</param>
        /// <param name="inputFile">The input file.</param>
        /// <param name="headers">True if headers are present.</param>
        /// <param name="format">The format.</param>
        public void Analyze(EncogAnalyst theAnalyst,
                            FileInfo inputFile, bool headers, CSVFormat format)
        {
            InputFilename = inputFile;
            ExpectInputHeaders = headers;
            Format = format;

            Analyzed = true;
            _analyst = theAnalyst;

            PerformBasicCounts();
            _fileColumns = InputHeadings.Length;
            _outputColumns = _analyst.DetermineOutputFieldCount();

            _analystHeaders = new CSVHeaders(InputHeadings);
            _series = new TimeSeriesUtil(_analyst, false,
                                        _analystHeaders.Headers);
        }
开发者ID:JDFagan,项目名称:encog-dotnet-core,代码行数:27,代码来源:AnalystEvaluateCSV.cs

示例7: TimeSeriesUtil

        /// <summary>
        ///     Construct the time-series utility.
        /// </summary>
        /// <param name="theAnalyst">The analyst to use.</param>
        /// <param name="includeOutput">Should output fields be included.</param>
        /// <param name="headings">The column headings.</param>
        public TimeSeriesUtil(EncogAnalyst theAnalyst, bool includeOutput,
                              IEnumerable<string> headings)
        {
            _buffer = new List<double[]>();
            _headingMap = new Dictionary<String, Int32>();
            _analyst = theAnalyst;
            _lagDepth = _analyst.LagDepth;
            _leadDepth = _analyst.LeadDepth;
            _totalDepth = _lagDepth + _leadDepth + 1;
            _inputSize = includeOutput ? _analyst.DetermineTotalColumns() : _analyst.DetermineTotalInputFieldCount();
            _outputSize = _analyst.DetermineInputCount()
                          + _analyst.DetermineOutputCount();

            int headingIndex = 0;

            foreach (String column  in  headings)
            {
                _headingMap[column.ToUpper()] = headingIndex++;
            }
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:26,代码来源:TimeSeriesUtil.cs

示例8: CmdCode

 /// <summary>
 ///     Construct this generate command.
 /// </summary>
 /// <param name="analyst">The analyst to use.</param>
 public CmdCode(EncogAnalyst analyst)
     : base(analyst)
 {
 }
开发者ID:CreativelyMe,项目名称:encog-dotnet-core,代码行数:8,代码来源:CmdCode.cs

示例9: CmdTrain

 /// <summary>
 ///     Construct the train command.
 /// </summary>
 /// <param name="analyst">The analyst to use.</param>
 public CmdTrain(EncogAnalyst analyst)
     : base(analyst)
 {
 }
开发者ID:kedrzu,项目名称:encog-dotnet-core,代码行数:8,代码来源:CmdTrain.cs

示例10: AnalystWizard

 /// <summary>
 ///     Construct the analyst wizard.
 /// </summary>
 /// <param name="theAnalyst">The analyst to use.</param>
 public AnalystWizard(EncogAnalyst theAnalyst)
 {
     _directClassification = false;
     _taskSegregate = true;
     _taskRandomize = true;
     _taskNormalize = true;
     _taskBalance = false;
     _taskCluster = true;
     _range = NormalizeRange.NegOne2One;
     _analyst = theAnalyst;
     _script = _analyst.Script;
     _methodType = WizardMethodType.FeedForward;
     TargetFieldName = "";
     _goal = AnalystGoal.Classification;
     _leadWindowSize = 0;
     _lagWindowSize = 0;
     _includeTargetField = false;
     _missing = new DiscardMissing();
     MaxError = DefaultTrainError;
     NaiveBayes = false;
 }
开发者ID:benw408701,项目名称:MLHCTransactionPredictor,代码行数:25,代码来源:AnalystWizard.cs

示例11: DetermineMode

        /// <summary>
        /// Determine the mode, this is the class item that has the most instances.
        /// </summary>
        /// <param name="analyst">The analyst to use.</param>
        /// <returns>The mode.</returns>
        public int DetermineMode(EncogAnalyst analyst)
        {
            if (!Classify)
            {
                throw new AnalystError("Can only calculate the mode for a class.");
            }

            DataField df = analyst.Script.FindDataField(Name);
            AnalystClassItem m = null;
            int result = 0;
            int idx = 0;
            foreach (AnalystClassItem item in df.ClassMembers)
            {
                if (m == null || m.Count < item.Count)
                {
                    m = item;
                    result = idx;
                }
                idx++;
            }

            return result;
        }
开发者ID:firestrand,项目名称:encog-dotnet-core,代码行数:28,代码来源:AnalystField.cs

示例12: Cmd

 /// <summary>
 /// Construct this command.
 /// </summary>
 ///
 /// <param name="theAnalyst">The analyst that this command belongs to.</param>
 protected Cmd(EncogAnalyst theAnalyst)
 {
     _analyst = theAnalyst;
     _script = _analyst.Script;
     _properties = _script.Properties;
 }
开发者ID:neismit,项目名称:emds,代码行数:11,代码来源:Cmd.cs

示例13: CmdCreate

 /// <summary>
 ///     Construct the create command.
 /// </summary>
 /// <param name="theAnalyst">The analyst to use.</param>
 public CmdCreate(EncogAnalyst theAnalyst) : base(theAnalyst)
 {
 }
开发者ID:jongh0,项目名称:MTree,代码行数:7,代码来源:CmdCreate.cs

示例14: CmdEvaluate

 /// <summary>
 /// Construct the evaluate command.
 /// </summary>
 ///
 /// <param name="theAnalyst">The analyst to use.</param>
 public CmdEvaluate(EncogAnalyst theAnalyst)
     : base(theAnalyst)
 {
 }
开发者ID:neismit,项目名称:emds,代码行数:9,代码来源:CmdEvaluate.cs

示例15: CmdSegregate

 /// <summary>
 /// Construct the segregate command.
 /// </summary>
 ///
 /// <param name="analyst">The analyst to use.</param>
 public CmdSegregate(EncogAnalyst analyst)
     : base(analyst)
 {
 }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:9,代码来源:CmdSegregate.cs


注:本文中的EncogAnalyst类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。