private void ClassificationMethodCombo_SelectionChanged(object sender, SelectionChangedEventArgs e) { ClassificationMethod method = (ClassificationMethod)(sender as ComboBox).SelectedItem; IntervalCombo.IsEnabled = (method == ClassificationMethod.StandardDeviation) ? true : false; BreakCountTb.IsEnabled = (method == ClassificationMethod.StandardDeviation) ? false : true; }
/// <summary> /// Applies the Classify colorizer to the basic raster layer. /// </summary> /// <param name="basicRasterLayer">The basic raster layer is either a raster or image service layer, or the image sub-layer of the mosaic layer.</param> /// <returns></returns> public static async Task SetToClassifyColorizer(BasicRasterLayer basicRasterLayer) { // Defines values for parameters in colorizer definition. string fieldName = "Value"; ClassificationMethod classificationMethod = ClassificationMethod.NaturalBreaks; int numberofClasses = 7; string colorRampStyle = "ArcGIS Colors"; string colorRampName = "Aspect"; await QueuedTask.Run(async() => { // Gets a color ramp from a style. IList <ColorRampStyleItem> rampList = GetColorRampsFromStyleAsync(Project.Current, colorRampStyle, colorRampName); CIMColorRamp colorRamp = rampList[0].ColorRamp; // Creates a new Classify Colorizer Definition using defined parameters. ClassifyColorizerDefinition classifyColorizerDef = new ClassifyColorizerDefinition(fieldName, numberofClasses, classificationMethod, colorRamp); // Creates a new Classify colorizer using the colorizer definition created above. CIMRasterClassifyColorizer newColorizer = await basicRasterLayer.CreateColorizerAsync(classifyColorizerDef) as CIMRasterClassifyColorizer; // Sets the newly created colorizer on the layer. basicRasterLayer.SetColorizer(newColorizer); }); }
public override RegressionModel Train(BaseVector[] x, int[] nominal, double[] y, Parameters param, int ntheads, Action <double> reportProgress) { x = ClassificationMethod.ToOneHotEncoding(x, nominal); int k = param.GetParam <int>("Number of neighbours").Value; IDistance distance = Distances.GetDistanceFunction(param); return(new KnnRegressionModel(x, y, k, distance)); }
public ClassificationWithRankingMultiSizes(ClassificationMethod classifier, ClassificationFeatureRankingMethod ranker, double reductionFactor, int maxFeatures, Parameters classifierParam, Parameters rankerParam) { this.classifier = classifier; this.ranker = ranker; this.reductionFactor = reductionFactor; this.maxFeatures = maxFeatures; this.classifierParam = classifierParam; this.rankerParam = rankerParam; }
public ClassificationWithRanking(ClassificationMethod classifier, ClassificationFeatureRankingMethod ranker, int nfeatures, Parameters classifierParam, Parameters rankerParam, bool groupWiseSelection, int[] groupWiseNfeatures) { this.classifier = classifier; this.ranker = ranker; this.nfeatures = nfeatures; this.classifierParam = classifierParam; this.rankerParam = rankerParam; this.groupWiseSelection = groupWiseSelection; this.groupWiseNfeatures = groupWiseNfeatures; }
public override RegressionModel Train(BaseVector[] x, int[] nominal, double[] y, Parameters param, int nthreads, Action <double> reportProgress) { x = ClassificationMethod.ToOneHotEncoding(x, nominal); ParameterWithSubParams <int> kernelParam = param.GetParamWithSubParams <int>("Kernel"); SvmParameter sp = new SvmParameter { kernelFunction = KernelFunctions.GetKernelFunction(kernelParam.Value, kernelParam.GetSubParameters()), svmType = SvmType.EpsilonSvr, c = param.GetParam <double>("C").Value }; SvmModel model = SvmMain.SvmTrain(new SvmProblem(x, y), sp); return(new SvmRegressionModel(model)); }
private void PageListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (sender != null) { ((ChildPage)(((ListBox)sender).Parent)).IsOpen = false; if (((ListBox)sender).Tag != null) { if (((ListBox)sender).Tag.ToString().Equals("ClassificationMethod")) { ClassificationMethod method = (ClassificationMethod)(sender as ListBox).SelectedItem; IntervalButton.IsEnabled = (method == ClassificationMethod.StandardDeviation) ? true : false; BreakCountTB.IsEnabled = (method == ClassificationMethod.StandardDeviation) ? false : true; } else if (((ListBox)sender).Tag.ToString().Equals("NormalizationType")) { NormalizationType normType = (NormalizationType)(sender as ListBox).SelectedItem; NormalizationFieldButton.IsEnabled = (normType == NormalizationType.Field) ? true : false; } } } }
public override RegressionModel Train(BaseVector[] x, int[] nominal, double[] y, Parameters param, int nthreads, Action <double> reportProgress) { x = ClassificationMethod.ToOneHotEncoding(x, nominal); throw new System.NotImplementedException(); }