/// <summary> /// Construct an analyzed field. /// </summary> /// <param name="theScript">The script being analyzed.</param> /// <param name="name">The name of the field.</param> public AnalyzedField(AnalystScript theScript, String name) : base(name) { _classMap = new Dictionary <String, AnalystClassItem>(); _instances = 0; _script = theScript; _fmt = _script.DetermineFormat(); }
/// <summary> /// Construct the analysis object. /// </summary> /// <param name="theScript">The script to use.</param> /// <param name="theFilename">The name of the file to analyze.</param> /// <param name="theHeaders">True if headers are present.</param> /// <param name="theFormat">The format of the file being analyzed.</param> public PerformAnalysis(AnalystScript theScript, String theFilename, bool theHeaders, AnalystFileFormat theFormat) { _filename = theFilename; _headers = theHeaders; _format = theFormat; _script = theScript; }
/// <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; _targetField = ""; _goal = AnalystGoal.Classification; _leadWindowSize = 0; _lagWindowSize = 0; _includeTargetField = false; _missing = new DiscardMissing(); }
/// <summary> /// Construct the Encog analyst. /// </summary> /// public EncogAnalyst() { _script = new AnalystScript(); _listeners = new List <IAnalystListener>(); _currentQuantTask = null; _commands = new Dictionary <String, Cmd>(); MaxIteration = -1; AddCommand(new CmdCreate(this)); AddCommand(new CmdEvaluate(this)); AddCommand(new CmdEvaluateRaw(this)); AddCommand(new CmdGenerate(this)); AddCommand(new CmdNormalize(this)); AddCommand(new CmdRandomize(this)); AddCommand(new CmdSegregate(this)); AddCommand(new CmdTrain(this)); AddCommand(new CmdBalance(this)); AddCommand(new CmdSet(this)); AddCommand(new CmdReset(this)); AddCommand(new CmdCluster(this)); }
/// <summary> /// Init the normalized fields. /// </summary> /// <param name="script">The script.</param> public void Init(AnalystScript script) { if (_normalizedFields == null) { return; } foreach (AnalystField norm in _normalizedFields) { DataField f = script.FindDataField(norm.Name); if (f == null) { throw new AnalystError("Normalize specifies unknown field: " + norm.Name); } if (norm.Action == NormalizationAction.Normalize) { norm.ActualHigh = f.Max; norm.ActualLow = f.Min; } if ((norm.Action == NormalizationAction.Equilateral) || (norm.Action == NormalizationAction.OneOf) || (norm.Action == NormalizationAction.SingleField)) { int index = 0; foreach (AnalystClassItem item in f.ClassMembers) { norm.Classes.Add(new ClassItem(item.Name, index++)); } } } }
/// <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; }
/// <summary> /// Construct the object. /// </summary> public AnalystNormalize(AnalystScript script) { _normalizedFields = new List <AnalystField>(); _script = script; }
/// <summary> /// Construct the object. /// </summary> public AnalystNormalize(AnalystScript script) { _normalizedFields = new List<AnalystField>(); _script = script; }
/// <summary> /// Init the normalized fields. /// </summary> /// /// <param name="script">The script.</param> public void Init(AnalystScript script) { if (_normalizedFields == null) { return; } foreach (AnalystField norm in _normalizedFields) { DataField f = script.FindDataField(norm.Name); if (f == null) { throw new AnalystError("Normalize specifies unknown field: " + norm.Name); } if (norm.Action == NormalizationAction.Normalize) { norm.ActualHigh = f.Max; norm.ActualLow = f.Min; } if ((norm.Action == NormalizationAction.Equilateral) || (norm.Action == NormalizationAction.OneOf) || (norm.Action == NormalizationAction.SingleField)) { int index = 0; foreach (AnalystClassItem item in f.ClassMembers) { norm.Classes.Add(new ClassItem(item.Name, index++)); } } } }