使用时间序列崩溃的Encog Analyst向导。找到错误

时间:2015-01-27 09:28:44

标签: time-series encog

我尝试在代码中使用Encog Analyst Wizard 3.3.0 C#。不使用时间序列时工作正常,但如果LagWindowSize>将输入计数设置为0。 0.

        FileInfo rawFile = new FileInfo("data.csv");       // The one and only input
        FileInfo analystFile = new FileInfo("data.ega");   // Wizard output file

        EncogAnalyst encog = new EncogAnalyst();
        encog.AddAnalystListener(new ConsoleAnalystListener());
        AnalystWizard wiz = new AnalystWizard(encog);

        wiz.Goal = AnalystGoal.Regression;
        wiz.TargetFieldName = "Close";
        wiz.IncludeTargetField = true;
->>>>   wiz.LagWindowSize = 10;              // No inputCount if LagWindowSize > 0
        wiz.LeadWindowSize = 2; 

        wiz.TaskSegregate = true; 
        wiz.MaxError = 0.01;
        wiz.TaskNormalize = true;
        wiz.Range = NormalizeRange.Zero2One;    // Sigmoid

        wiz.TaskCluster = false;
        wiz.TaskRandomize = false;
        wiz.TaskBalance = false;

        wiz.Wizard(rawFile, true, AnalystFileFormat.DecpntComma);
//                              
// Crashes on task Create below because inputCount becomes 0 with.LagWindowSize > 0
// but works if wiz.LagWindowSize is set to 0 ... What am I missing here???
//
  ->>>>   encog.ExecuteTask("task-full");   // task-create fails !

此致 彼得

1 个答案:

答案 0 :(得分:1)

经过一些调试后,我发现了AnalystWizard.cs v3.3中的一个错误,私有void ExpandTimeSlices()约。第700行:

// swap back in
oldList.Clear(); // oldList is cleared and then used in a foreach …

// Original line:  foreach (AnalystField item in oldList)

// New line:
foreach (AnalystField item in newList)  // Correct list !!!
{
    oldList.Add(item);
}

仅当wiz.LagWindowSize>执行这些行时才会执行。 0