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


C# NormalizationAction类代码示例

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


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

示例1: LoadAndNormalizeData

        public static IMLDataSet LoadAndNormalizeData(FileInfo fileInfo, AnalystGoal problemType, NormalizationAction normalizationType, bool randomize = true)
        {
            var analyst = new EncogAnalyst();
            var wizard = new AnalystWizard(analyst);
            wizard.Goal = problemType;
            wizard.Wizard(fileInfo, true, AnalystFileFormat.DecpntComma);
            var fields = analyst.Script.Normalize.NormalizedFields;

            if (problemType == AnalystGoal.Classification)
                fields[fields.Count - 1].Action = normalizationType;

            var norm = new AnalystNormalizeCSV();
            norm.Analyze(fileInfo, true, CSVFormat.DecimalPoint, analyst);

            var normalizedDataFileInfo = new FileInfo("temp/temp.csv");
            norm.Normalize(normalizedDataFileInfo);

            var inputNeurons = fields.Count - 1;
            int outputNeurons;
            if (problemType == AnalystGoal.Classification)
                outputNeurons = fields.Last().Classes.Count - (normalizationType == NormalizationAction.Equilateral ? 1 : 0);
            else
                outputNeurons = fields.Count - inputNeurons;
            var result = CSVHelper.LoadCSVToDataSet(normalizedDataFileInfo, inputNeurons, outputNeurons, randomize);
            normalizedDataFileInfo.Delete();
            return result;
        }
开发者ID:JGrzybowski,项目名称:NeuralNetworksSmallProject,代码行数:27,代码来源:CSVHelper.cs

示例2: NormalizedField

 public NormalizedField(string theName, NormalizationAction theAction, double high, double low)
 {
     this._x8affa5274961ba3a = new List<ClassItem>();
     if (1 != 0)
     {
         this._xba38fdafb6633fdf = new Dictionary<string, int>();
         this._xc15bd84e01929885 = theName;
     }
     this._xab8fe3cd8c5556fb = theAction;
     this._x891507b50bbab0f9 = high;
     this._x136bfff0efb12047 = low;
 }
开发者ID:neismit,项目名称:emds,代码行数:12,代码来源:NormalizedField.cs

示例3: NormalizedField

 /// <summary>
 /// Construct the object.
 /// </summary>
 ///
 /// <param name="theNormalizedHigh">The normalized high.</param>
 /// <param name="theNormalizedLow">The normalized low.</param>
 public NormalizedField(double theNormalizedHigh,
     double theNormalizedLow)
 {
     _classes = new List<ClassItem>();
     _lookup = new Dictionary<String, Int32>();
     _normalizedHigh = theNormalizedHigh;
     _normalizedLow = theNormalizedLow;
     _actualHigh = Double.MinValue;
     _actualLow = Double.MaxValue;
     _action = NormalizationAction.Normalize;
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:17,代码来源:NormalizedField.cs

示例4: MakeClass

        /// <summary>
        /// Create a field that will be used to hold a class.
        /// </summary>
        ///
        /// <param name="theAction">The action for this field.</param>
        /// <param name="cls">The class items.</param>
        /// <param name="high">The output high value.</param>
        /// <param name="low">The output low value.</param>
        public void MakeClass(NormalizationAction theAction,
            String[] cls, double high, double low)
        {
            if ((theAction != NormalizationAction.Equilateral)
                && (theAction != NormalizationAction.OneOf)
                && (theAction != NormalizationAction.SingleField))
            {
                throw new QuantError("Unsupported normalization type");
            }

            _action = theAction;
            _classes.Clear();
            _normalizedHigh = high;
            _normalizedLow = low;
            _actualHigh = 0;
            _actualLow = 0;

            for (int i = 0; i < cls.Length; i++)
            {
                _classes.Insert(i, new ClassItem(cls[i], i));
            }
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:30,代码来源:NormalizedField.cs

示例5: MakeClass

 public void MakeClass(NormalizationAction theAction, string[] cls, double high, double low)
 {
     int num;
     if (theAction == NormalizationAction.Equilateral)
     {
         goto Label_00CA;
     }
     Label_00B7:
     if ((theAction != NormalizationAction.OneOf) && (theAction != NormalizationAction.SingleField))
     {
         throw new QuantError("Unsupported normalization type");
     }
     Label_00CA:
     this._xab8fe3cd8c5556fb = theAction;
     if ((((uint) num) - ((uint) high)) <= uint.MaxValue)
     {
         if ((((uint) high) - ((uint) high)) <= uint.MaxValue)
         {
             this._x8affa5274961ba3a.Clear();
             this._x891507b50bbab0f9 = high;
         }
         this._x136bfff0efb12047 = low;
         while (true)
         {
             this._x945de103a2446d98 = 0.0;
             this._x4a1b740f8a477de7 = 0.0;
             num = 0;
             while (num < cls.Length)
             {
                 this._x8affa5274961ba3a.Insert(num, new ClassItem(cls[num], num));
                 num++;
                 if (0 != 0)
                 {
                     return;
                 }
             }
             if ((((uint) high) & 0) == 0)
             {
                 return;
             }
         }
     }
     goto Label_00B7;
 }
开发者ID:neismit,项目名称:emds,代码行数:44,代码来源:NormalizedField.cs

示例6: MakeClass

 public void MakeClass(NormalizationAction theAction, int classFrom, int classTo, int high, int low)
 {
     if (this._xab8fe3cd8c5556fb != NormalizationAction.Equilateral)
     {
         goto Label_00FB;
     }
     Label_006C:
     this._xab8fe3cd8c5556fb = theAction;
     this._x8affa5274961ba3a.Clear();
     this._x891507b50bbab0f9 = high;
     this._x136bfff0efb12047 = low;
     Label_0090:
     this._x945de103a2446d98 = 0.0;
     this._x4a1b740f8a477de7 = 0.0;
     int num = 0;
     int num2 = classFrom;
     while (true)
     {
         if (num2 < classTo)
         {
             this._x8affa5274961ba3a.Add(new ClassItem(num2, num++));
         }
         else
         {
             if ((((uint) num2) & 0) == 0)
             {
                 return;
             }
             break;
         }
         if ((((uint) high) - ((uint) classTo)) >= 0)
         {
         }
         num2++;
         if ((((uint) low) & 0) != 0)
         {
             goto Label_0090;
         }
     }
     Label_00FB:
     if ((this._xab8fe3cd8c5556fb == NormalizationAction.OneOf) && ((((uint) num) + ((uint) classFrom)) >= 0))
     {
         goto Label_006C;
     }
     if (this._xab8fe3cd8c5556fb != NormalizationAction.SingleField)
     {
         throw new QuantError("Unsupported normalization type");
     }
     if (((uint) high) <= uint.MaxValue)
     {
         if ((((uint) classTo) + ((uint) classFrom)) <= uint.MaxValue)
         {
             goto Label_006C;
         }
     }
     else
     {
         goto Label_00FB;
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:60,代码来源:AnalystField.cs

示例7: MakePassThrough

 public void MakePassThrough()
 {
     this._x891507b50bbab0f9 = 0.0;
     this._x136bfff0efb12047 = 0.0;
     this._x945de103a2446d98 = 0.0;
     this._x4a1b740f8a477de7 = 0.0;
     this._xab8fe3cd8c5556fb = NormalizationAction.PassThrough;
 }
开发者ID:neismit,项目名称:emds,代码行数:8,代码来源:NormalizedField.cs

示例8: MakePassThrough

 /// <summary>
 /// Make this a pass-through field.
 /// </summary>
 ///
 public void MakePassThrough()
 {
     _normalizedHigh = 0;
     _normalizedLow = 0;
     _actualHigh = 0;
     _actualLow = 0;
     _action = NormalizationAction.PassThrough;
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:12,代码来源:NormalizedField.cs

示例9: AnalystField

 public AnalystField(AnalystField field)
 {
     if (8 != 0)
     {
         if (0 == 0)
         {
             this._x8affa5274961ba3a = new List<ClassItem>();
             this._xba38fdafb6633fdf = new Dictionary<string, int>();
             this._x945de103a2446d98 = field._x945de103a2446d98;
             this._x4a1b740f8a477de7 = field._x4a1b740f8a477de7;
         }
         else
         {
             goto Label_0093;
         }
     }
     this._x891507b50bbab0f9 = field._x891507b50bbab0f9;
     this._x136bfff0efb12047 = field._x136bfff0efb12047;
     this._xab8fe3cd8c5556fb = field._xab8fe3cd8c5556fb;
     Label_0093:
     if (0xff != 0)
     {
         this._xc15bd84e01929885 = field._xc15bd84e01929885;
         this._x9c13656d94fc62d0 = field._x9c13656d94fc62d0;
         this._xb28caf42bc38fd60 = field._xb28caf42bc38fd60;
     }
 }
开发者ID:neismit,项目名称:emds,代码行数:27,代码来源:AnalystField.cs

示例10: AnalystField

 /// <summary>
 /// Construct an analyst field.  Works like a C++ copy constructor.  
 /// </summary>
 ///
 /// <param name="field">The field to clone.</param>
 public AnalystField(AnalystField field)
 {
     _classes = new List<ClassItem>();
     _lookup = new Dictionary<String, Int32>();
     _actualHigh = field._actualHigh;
     _actualLow = field._actualLow;
     _normalizedHigh = field._normalizedHigh;
     _normalizedLow = field._normalizedLow;
     _action = field._action;
     _name = field._name;
     _output = field._output;
     _timeSlice = field._timeSlice;
     FixSingleValue();
 }
开发者ID:firestrand,项目名称:encog-dotnet-core,代码行数:19,代码来源:AnalystField.cs


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