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 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 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); }