コード例 #1
0
        public static int sampleSizeKappa(string AccuracyAssessmentModel, double proportionOfKappa = 0.1, double alpha = 0.05)
        {
            double z = zScore(alpha);
            dataGeneralConfusionMatirx gc = new dataGeneralConfusionMatirx();

            gc.getXTable(AccuracyAssessmentModel);
            double pe = gc.GeneralConfusionMatrix.ChanceAgreement;
            double k  = gc.Kappa;
            double n  = (k * (1 - k)) / (1 - pe) * Math.Pow((z / proportionOfKappa), 2);

            return(System.Convert.ToInt32(n));
        }
コード例 #2
0
        public void buildModel()
        {
            IGeometryBag        geoBag  = new GeometryBagClass();
            IGeometryCollection geoColl = (IGeometryCollection)geoBag;
            IFeatureCursor      ftCur   = projectArea.Search(null, false);
            IFeature            ftr     = ftCur.NextFeature();

            while (ftr != null)
            {
                geoColl.AddGeometry(ftr.Shape);
                ftr = ftCur.NextFeature();
            }
            dgc = new dataGeneralConfusionMatirx();
            dgc.getXTable(oModel);
            olabels  = dgc.Labels.ToList();
            xTable   = dgc.XTable;
            oClmProp = dgc.GeneralConfusionMatrix.ColumnProportions;
            nCnts    = new double[oClmProp.Length];
            adjustXTable((IGeometry)geoBag);
            gc    = new GeneralConfusionMatrix(xTable);
            kappa = gc.Kappa;
            ste   = gc.StandardError;
            writeXTable();
        }
 public void buildModel()
 {
     IGeometryBag geoBag = new GeometryBagClass();
     IGeometryCollection geoColl = (IGeometryCollection)geoBag;
     IFeatureCursor ftCur = projectArea.Search(null, false);
     IFeature ftr = ftCur.NextFeature();
     while (ftr != null)
     {
         geoColl.AddGeometry(ftr.Shape);
         ftr = ftCur.NextFeature();
     }
     dgc = new dataGeneralConfusionMatirx();
     dgc.getXTable(oModel);
     olabels = dgc.Labels.ToList();
     xTable = dgc.XTable;
     oClmProp = dgc.GeneralConfusionMatrix.ColumnProportions;
     nCnts = new double[oClmProp.Length];
     adjustXTable((IGeometry)geoBag);
     gc = new GeneralConfusionMatrix(xTable);
     kappa = gc.Kappa;
     ste = gc.StandardError;
     writeXTable();
 }
 private void createAAModel(string[] paramArr)
 {
     ITable table = getTable(paramArr[1]);
     string dependentField = paramArr[2];
     string independentField = paramArr[3];
     Statistics.dataGeneralConfusionMatirx dpAa = new Statistics.dataGeneralConfusionMatirx(table, dependentField, independentField);
     if (paramArr.Length > 5) dpAa.WeightFeild = paramArr[4];
     dpAa.writeXTable(paramArr[paramArr.Length-1]);
 }
 public static int sampleSizeKappa(string AccuracyAssessmentModel, double proportionOfKappa=0.1, double alpha = 0.05)
 {
     double z = zScore(alpha);
     dataGeneralConfusionMatirx gc= new dataGeneralConfusionMatirx();
     gc.getXTable(AccuracyAssessmentModel);
     double pe = gc.GeneralConfusionMatrix.ChanceAgreement;
     double k = gc.Kappa;
     double n = (k*(1-k))/(1-pe)*Math.Pow((z/proportionOfKappa),2);
     return System.Convert.ToInt32(n);
 }
 public void selectAccuracyFeaturesToSample(ITable inputTable, string AccuracyAssessmentModelPath, string mapField, double proportionOfMean, double alpha, bool weightsEqual=false)
 {
     esriUtil.Statistics.dataGeneralConfusionMatirx dGc = new Statistics.dataGeneralConfusionMatirx();
     dGc.getXTable(AccuracyAssessmentModelPath);
     List<string> labels = dGc.Labels.ToList();
     int samplesPerClass = esriUtil.Statistics.dataPrepSampleSize.sampleSizeKappa(AccuracyAssessmentModelPath, proportionOfMean, alpha)/labels.Count + 1;
     selectEqualFeaturesToSample(inputTable, mapField, samplesPerClass, weightsEqual);
 }