コード例 #1
0
 public override string ToString()
 {
     if (this.Data == null)
     {
         return("Matrix: " + this.RowCount + "x" + this.ColumnCount + " : {}");
     }
     else
     {
         return("Matrix: " + this.RowCount + "x" + this.ColumnCount + " : " + ToolsCollection.ToString(this.ToArray2DFloat64()));
     }
 }
コード例 #2
0
        private static void ProccessDataSetNominalNearestNeighbor(IDataSet <int, int> training_set, IDataSet <int, int> test_set)
        {
            ITemplateModelDiscrete <int, int> template = new TemplateModelFeatureSelecting <int, int>(
                new FeatureSelectorGreedy <int, int>(
                    new EvaluatorReapetedRandomFold <int, int>(10)),
                new TemplateModelNearestNeighborNominal());
            ReportDiscrete <int, int> report = template.GenerateAndTestDiscrete(training_set, test_set);

            Console.WriteLine(ToolsCollection.ToString(report.ConfusionMatrixInstances));
            Console.WriteLine(report.CorrectLabelRate);
        }
コード例 #3
0
 public static void PrintField <ElementType>(
     IAlgebraFieldFinite <ElementType> field)
 {
     Console.WriteLine("add table");
     Console.WriteLine(ToolsCollection.ToString(ToolsMathFiniteField.GetAdditionTable(field)));
     Console.WriteLine("subtract table");
     Console.WriteLine(ToolsCollection.ToString(ToolsMathFiniteField.GetSubtractionTable(field)));
     Console.WriteLine("multiply table");
     Console.WriteLine(ToolsCollection.ToString(ToolsMathFiniteField.GetMultiplicationTable(field)));
     Console.WriteLine("divide table");
     Console.WriteLine(ToolsCollection.ToString(ToolsMathFiniteField.GetDivisionTable(field)));
 }
コード例 #4
0
        private static void ProccessDataSetNominalSupportVectorMachine(IDataSet <int, int> training_set, IDataSet <int, int> test_set)
        {
            //ITemplateModelInterval<int, IModelLikelyHood<double[], int, double>>
            IDataSet <double, int> training_set_interval = training_set.ConvertToDataSetInterval();
            IDataSet <double, int> test_set_interval     = test_set.ConvertToDataSetInterval();
            //ITemplateModelDiscrete<IDataSetIntervalLabeled<double,int>, IModelLikelyHood<double[], int, double>> template =
            //    new TemplateModelFeatureSelecting<double, int, IDataSetIntervalLabeled<double, int>>(
            //        new FeatureSelectorGreedy<double, int, IDataSetIntervalLabeled<double,int>>(
            //        new EvaluatorReapetedRandomFold<double, int, IDataSetIntervalLabeled<double, int>>(10)),
            //        new TemplateModelLibSVMCSVC());

            ITemplateModelDiscrete <double, int> template = new TemplateModelLibSVMCSVC(100, 5);

            ReportDiscrete <double, int> report = template.GenerateAndTestDiscrete(training_set_interval, test_set_interval);

            Console.WriteLine(ToolsCollection.ToString(report.ConfusionMatrixInstances));
            Console.WriteLine(report.CorrectLabelRate);
        }