Beispiel #1
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string smpFtrNm = cmbSampleFeatureClass.Text;
            string depFld   = cmbDepedent.Text;
            string outP     = txtOutputPath.Text;

            if (smpFtrNm == null || smpFtrNm == "")
            {
                MessageBox.Show("You must select a feature Class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (depFld == null || depFld == "")
            {
                MessageBox.Show("You must select a dependent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (outP == null || outP == "")
            {
                MessageBox.Show("You must select an output model path", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            List <string> lstInd = new List <string>();

            for (int i = 0; i < lstIndependent.Items.Count; i++)
            {
                string s = lstIndependent.Items[i].ToString();
                lstInd.Add(s);
            }
            if (lstInd.Count < 1)
            {
                MessageBox.Show("You must select at least one independent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (!lstCategoricalFlds.Contains(depFld))
            {
                lstCategoricalFlds.Add(depFld);
            }
            this.Visible = false;
            try
            {
                Statistics.ModelHelper.runProgressBar("Running SoftMax Nnet");
                ITable ftrCls = ftrDic[smpFtrNm];
                Statistics.dataPrepSoftMaxPlr sm = new Statistics.dataPrepSoftMaxPlr(ftrCls, new string[] { depFld }, lstInd.ToArray(), lstCategoricalFlds.ToArray());
                sm.writeModel(outP);
                sm.getReport();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Statistics.ModelHelper.closeProgressBar();
                this.Close();
            }
        }
Beispiel #2
0
 public void Bind(object pArgument)
 {
     if (pArgument is softMaxFunctionArguments)
     {
         softMaxFunctionArguments arg = (softMaxFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         outrs         = arg.OutRaster;
         xVls          = new double[((IRasterBandCollection)inrsBandsCoef).Count];
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         lm = arg.LogitModel;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: plrFunctionArguments");
     }
 }
 public void Bind(object pArgument)
 {
     if (pArgument is softMaxFunctionArguments)
     {
         softMaxFunctionArguments arg = (softMaxFunctionArguments)pArgument;
         inrsBandsCoef = arg.InRasterCoefficients;
         outrs = arg.OutRaster;
         xVls = new double[((IRasterBandCollection)inrsBandsCoef).Count];
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         lm = arg.LogitModel;
         myFunctionHelper.Bind(outrs);
         myFunctionHelperCoef.Bind(inrsBandsCoef);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype = myRasterInfo.PixelType;
         myValidFlag = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: plrFunctionArguments");
     }
 }
 private void btnExecute_Click(object sender, EventArgs e)
 {
     string smpFtrNm = cmbSampleFeatureClass.Text;
     string depFld = cmbDepedent.Text;
     string outP = txtOutputPath.Text;
     if (smpFtrNm == null || smpFtrNm == "")
     {
         MessageBox.Show("You must select a feature Class","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return;
     }
     if (depFld == null || depFld == "")
     {
         MessageBox.Show("You must select a dependent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (outP == null || outP == "")
     {
         MessageBox.Show("You must select an output model path", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     List<string> lstInd = new List<string>();
     for (int i = 0; i < lstIndependent.Items.Count; i++)
     {
         string s = lstIndependent.Items[i].ToString();
         lstInd.Add(s);
     }
     if (lstInd.Count < 1)
     {
         MessageBox.Show("You must select at least one independent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (!lstCategoricalFlds.Contains(depFld)) lstCategoricalFlds.Add(depFld);
     this.Visible = false;
     try
     {
         Statistics.ModelHelper.runProgressBar("Running SoftMax Nnet");
         ITable ftrCls = ftrDic[smpFtrNm];
         Statistics.dataPrepSoftMaxPlr sm = new Statistics.dataPrepSoftMaxPlr(ftrCls, new string[] { depFld }, lstInd.ToArray(), lstCategoricalFlds.ToArray());
         sm.writeModel(outP);
         sm.getReport();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         Statistics.ModelHelper.closeProgressBar();
         this.Close();
     }
 }