예제 #1
0
 /// <summary>
 /// Froms the bar series to a double array.
 /// </summary>
 /// <param name="thebarserie">The thebarserie.</param>
 /// <returns></returns>
 public static double[] FromBarSeriestoDouble(Encog.App.Quant.Loader.OpenQuant.IDataSeries thebarserie)
 {
     double[] outputtedseries = new double[thebarserie.Count];
     int index = 0;
     foreach (Data.Data.Bar abar in thebarserie)
     {
         outputtedseries[index] = abar.Close;
         index++;
     }
     return outputtedseries;
 }
예제 #2
0
파일: ScorePlayer.cs 프로젝트: tmassey/mtos
 public double CalculateScore(Encog.ML.IMLMethod network)
 {
     return score ();
 }
예제 #3
0
        public SupportVectorMachine(int theInputCount, Encog.ML.SVM.SVMType svmType, Encog.ML.SVM.KernelType kernelType)
        {
            goto Label_02B7;
            Label_000B:
            this._paras.nr_weight = 0;
            Label_0017:
            this._paras.weight_label = new int[0];
            this._paras.weight = new double[0];
            this._paras.gamma = 1.0 / ((double) this._inputCount);
            goto Label_00C6;
            Label_0057:
            this._paras.C = 1.0;
            this._paras.eps = 0.001;
            this._paras.p = 0.1;
            this._paras.shrinking = 1;
            this._paras.probability = 0;
            if ((((uint) theInputCount) + ((uint) theInputCount)) >= 0)
            {
                goto Label_000B;
            }
            Label_00C6:
            if (0 == 0)
            {
                return;
            }
            goto Label_02B7;
            Label_00D1:
            this._paras.degree = 3.0;
            this._paras.coef0 = 0.0;
            this._paras.nu = 0.5;
            if (0 != 0)
            {
                goto Label_0256;
            }
            this._paras.cache_size = 100.0;
            if (0 == 0)
            {
                goto Label_0057;
            }
            goto Label_019C;
            Label_0134:
            this._paras.kernel_type = 3;
            goto Label_00D1;
            Label_0167:
            this._paras.kernel_type = 0;
            goto Label_00D1;
            Label_019C:
            switch (kernelType)
            {
                case Encog.ML.SVM.KernelType.Linear:
                    goto Label_0167;

                case Encog.ML.SVM.KernelType.Poly:
                    this._paras.kernel_type = 1;
                    goto Label_00D1;

                case Encog.ML.SVM.KernelType.RadialBasisFunction:
                    this._paras.kernel_type = 2;
                    goto Label_00D1;

                case Encog.ML.SVM.KernelType.Sigmoid:
                    goto Label_0134;

                default:
                    throw new NeuralNetworkError("Invalid kernel type");
            }
            Label_01CD:
            throw new NeuralNetworkError("Invalid svm type");
            if ((((uint) theInputCount) - ((uint) theInputCount)) < 0)
            {
                goto Label_0134;
            }
            if (8 != 0)
            {
                goto Label_019C;
            }
            if ((((uint) theInputCount) + ((uint) theInputCount)) < 0)
            {
                goto Label_01CD;
            }
            goto Label_0167;
            if (0 == 0)
            {
                goto Label_00D1;
            }
            goto Label_0057;
            Label_0256:
            this._paras.svm_type = 2;
            goto Label_019C;
            Label_02B7:
            this._inputCount = theInputCount;
            this._paras = new svm_parameter();
            if ((((uint) theInputCount) - ((uint) theInputCount)) > uint.MaxValue)
            {
                goto Label_00D1;
            }
            switch (svmType)
            {
                case Encog.ML.SVM.SVMType.SupportVectorClassification:
                    this._paras.svm_type = 0;
                    if (0 != 0)
                    {
                        goto Label_0017;
                    }
                    goto Label_019C;

                case Encog.ML.SVM.SVMType.NewSupportVectorClassification:
                    this._paras.svm_type = 1;
                    if ((((uint) theInputCount) | uint.MaxValue) == 0)
                    {
                        goto Label_000B;
                    }
                    goto Label_019C;

                case Encog.ML.SVM.SVMType.SupportVectorOneClass:
                    goto Label_0256;

                case Encog.ML.SVM.SVMType.EpsilonSupportVectorRegression:
                    this._paras.svm_type = 3;
                    if ((((uint) theInputCount) + ((uint) theInputCount)) <= uint.MaxValue)
                    {
                        goto Label_019C;
                    }
                    goto Label_02B7;

                case Encog.ML.SVM.SVMType.NewSupportVectorRegression:
                    this._paras.svm_type = 4;
                    if (((uint) theInputCount) > uint.MaxValue)
                    {
                        return;
                    }
                    goto Label_019C;

                default:
                    goto Label_01CD;
            }
        }
예제 #4
0
파일: SortedField.cs 프로젝트: neismit/emds
 public SortedField(int theIndexindex, Encog.App.Analyst.CSV.Sort.SortType t, bool theAscending)
 {
     this._xc0c4c459c6ccbd00 = theIndexindex;
     this.Ascending = theAscending;
     this._x0a082a37646d8463 = t;
 }