} /* InitiateClass */ public void Increment(PicesClass mlClass, float areaMM ) { if (mlClass == null) { mlClass = PicesClassList.GetUnKnownClassStatic(); } ClassTotals2 classTotals = totals.LookUp(mlClass.Name); if (classTotals == null) { classTotals = new ClassTotals2(mlClass.Name, sizeInitial, sizeGrowthFactor, sizeEndRange, bucketCount, sizeBucketStart, sizeBucketEnd ); totals.Add(classTotals); } classTotals.Increment(areaMM); } /* Increment */
private PicesPredictionList PredictClasses(PicesFeatureVector fv, PicesPrediction pred1, PicesPrediction pred2, String imageFileName, String imageFileRootName ) { PicesFeatureVector fvToUse = fv; PicesPredictionList probPredList = null; if (fvToUse.FeatureDataMissing) { fvToUse = null; // Feature data is missing. we need to compute from original image. PicesDataBaseImage pdbi = DbConn().ImageLoad(imageFileRootName); if (pdbi != null) { PicesRaster pr = DbConn().ImageFullSizeFind(imageFileRootName); if (pr == null) { ErrorMsgsAdd("Failed to Load FullSize image [" + imageFileRootName + "]"); } else { fvToUse = new PicesFeatureVector(pr, imageFileName, null, runLog); // Since we had to compute the FeatureDatya from the raster image we now need to // get the instrument data that matches it. PicesInstrumentData id = DbConn().InstrumentDataGetByScanLine(pdbi.SipperFileName, pdbi.TopLeftRow); if (id != null) { fvToUse.AddInstrumentData(id); } DbConn().FeatureDataInsertRow(pdbi.SipperFileName, fvToUse); pr.Dispose(); } pr = null; } } if (fvToUse != null) { classifier.PredictClass(fvToUse, pred1, pred2); probPredList = classifier.PredictProbabilities(fvToUse); } else { pred1.MLClass = PicesClassList.GetUnKnownClassStatic(); pred1.Probability = 1.0f; pred2.MLClass = PicesClassList.GetUnKnownClassStatic(); pred2.Probability = 0.0f; } return(probPredList); } /* PredictClasses */
} /* SizeDistribution */ /// <summary> /// Method used to guarantee that the specified class is included; even if none occur. /// </summary> /// <param name="mlClass">Class to add </param> public void InitiateClass(PicesClass mlClass) { if (mlClass == null) { mlClass = PicesClassList.GetUnKnownClassStatic(); } ClassTotals classTotals = totals.LookUp(mlClass.Name); if (classTotals == null) { classTotals = new ClassTotals(mlClass.Name, bucketCount, bucketSize); totals.Add(classTotals); } return; } /* InitiateClass */
} /* InitiateClass */ public void Increment(PicesClass mlClass, int size ) { if (mlClass == null) { mlClass = PicesClassList.GetUnKnownClassStatic(); } ClassTotals classTotals = totals.LookUp(mlClass.Name); if (classTotals == null) { classTotals = new ClassTotals(mlClass.Name, bucketCount, bucketSize); totals.Add(classTotals); } classTotals.Increment(size); } /* Increment */
} /* SizeDistribution2 */ /// <summary> /// Method used to guarantee that the specified class is included; even if none occur. /// </summary> /// <param name="mlClass">Class to add </param> public void InitiateClass(PicesClass mlClass) { if (mlClass == null) { mlClass = PicesClassList.GetUnKnownClassStatic(); } ClassTotals2 classTotals = totals.LookUp(mlClass.Name); if (classTotals == null) { classTotals = new ClassTotals2(mlClass.Name, sizeInitial, sizeGrowthFactor, sizeEndRange, bucketCount, sizeBucketStart, sizeBucketEnd ); totals.Add(classTotals); } return; } /* InitiateClass */