Package org.dmg.pmml31.NumericInfoDocument

Examples of org.dmg.pmml31.NumericInfoDocument.NumericInfo


        PMML pmmlObject = result.addNewPMML();
        pmmlObject.setVersion("3.0");
        // head of PMML document
        Header header = pmmlObject.addNewHeader();
        header.setCopyright("www.gridminer.org");
        Application application = header.addNewApplication();
        application.setName("GridMiner");
        application.setVersion("1.0");
        //data dictionary
        DataDictionary dataDictionary = pmmlObject.addNewDataDictionary();
        BigInteger pom = new BigInteger(String.valueOf(columnCount));
        dataDictionary.setNumberOfFields(pom);
       
View Full Code Here


                    numInfo.setMaximum(maximum[i]);
                    numInfo.setMean(mean[i]);
                    numInfo.setStandardDeviation(stddev[i]);               
                   
                    // ContStats                                                               
                    ContStats contsStats = statfield.addNewContStats();
                    contsStats.setTotalValuesSum(sum[i]);
                    contsStats.setTotalSquaresSum(sum2[i]);  
                                       
                    int intervalCount = interval[i].length;
                    for(int index=0; index<intervalCount; index++)
                    {
                        org.dmg.pmml31.IntervalDocument.Interval interv =
                            contsStats.addNewInterval();
                        interv.setLeftMargin(interval[i][index].getLeftMargin());
                        interv.setRightMargin(interval[i][index].getRightMargin());
                       
                        interv.setClosure(
                                Closure.Enum.forString(
View Full Code Here

       
        UnivariateStats[] stats =
            pmml.getMiningModelArray(0).getModelStats().getUnivariateStatsArray();       
        for (int i=0; i<columnCount; i++)
        {
            Counts counts = stats[i].getCounts();
            totalFreq[i] = counts.getTotalFreq().longValue();
            missingData[i] = counts.getMissingFreq().longValue();
            invalidFreq[i] = 0;
            distinctValue[i] = Integer.valueOf(counts.getExtensionArray(0).getValue()).intValue();
            String type = colInfo[i].getDataType();
            OPTYPE.Enum optype = pmml.getDataDictionary().getDataFieldArray(i).getOptype();
            if (optype == OPTYPE.CATEGORICAL)
            {
                // init discrete statistic for categorical optype
View Full Code Here

        for(int i=0; i<columnCount; i++)
        {
            UnivariateStats statfield = modelStats.addNewUnivariateStats();
            statfield.setField(colInfo[i].getName());
            // Counts
            Counts counts = statfield.addNewCounts();
            BigInteger pom = new BigInteger(String.valueOf(totalFreq[i]));
            counts.setTotalFreq(pom);
            pom = new BigInteger(String.valueOf(missingData[i]));
            counts.setMissingFreq(pom);
            pom = new BigInteger(String.valueOf(invalidFreq[i]));
            counts.setInvalidFreq(pom);           
            Extension ext = counts.addNewExtension();
            ext.setName("distinctValues");
            ext.setValue(String.valueOf(distinctValue[i]));
           
            //DiscrStats
            OPTYPE.Enum optype = mPMML.getDataDictionary().getDataFieldArray(i).getOptype();
View Full Code Here

        for (int i=0; i<columnCount; i++)
        {
            UnivariateStats statfield = modelStats.addNewUnivariateStats();
            statfield.setField(colInfo[i].getName());
            // counts
            Counts counts = statfield.addNewCounts();
            pom = new BigInteger(String.valueOf(totalFreq[i]));
            counts.setTotalFreq(pom);
            pom = new BigInteger(String.valueOf(missingData[i]));
            counts.setMissingFreq(pom);
           
            Extension ext = counts.addNewExtension();
            ext.setName("distinctValues");
            ext.setValue(String.valueOf(hashSet[i].size()));
           
            String colType = colInfo[i].getDataType();
            if (colType.equalsIgnoreCase("integer")||
View Full Code Here

        header.setCopyright("www.gridminer.org");
        Application application = header.addNewApplication();
        application.setName("GridMiner");
        application.setVersion("1.0");
        //data dictionary
        DataDictionary dataDictionary = pmmlObject.addNewDataDictionary();
        BigInteger pom = new BigInteger(String.valueOf(columnCount));
        dataDictionary.setNumberOfFields(pom);
       
        for (int i = 0; i < columnCount; i++)
        {
            DataField dataField = dataDictionary.addNewDataField();
            dataField.setName(colInfo[i].getName());
            dataField.setDisplayName(colInfo[i].getDisplayName());          
            //dataField[i].setDataType(DATATYPE.fromString(colInfo[i].getDataType()));
            dataField.setDataType(
                    DATATYPE.Enum.forString(colInfo[i].getDataType()));
View Full Code Here

        BigInteger pom = new BigInteger(String.valueOf(columnCount));
        dataDictionary.setNumberOfFields(pom);
       
        for (int i = 0; i < columnCount; i++)
        {
            DataField dataField = dataDictionary.addNewDataField();
            dataField.setName(colInfo[i].getName());
            dataField.setDisplayName(colInfo[i].getDisplayName());          
            //dataField[i].setDataType(DATATYPE.fromString(colInfo[i].getDataType()));
            dataField.setDataType(
                    DATATYPE.Enum.forString(colInfo[i].getDataType()));
            // all attribute are continuous in this phase
            dataField.setOptype(OPTYPE.CONTINUOUS);        
        }
       
        //ModelStat
        MiningModel miningModel = pmmlObject.addNewMiningModel();
        miningModel.setModelName("Statistica");
View Full Code Here

           
            //DiscrStats
            OPTYPE.Enum optype = mPMML.getDataDictionary().getDataFieldArray(i).getOptype();
            if(optype == OPTYPE.CATEGORICAL)
            {
                DiscrStats discrStats = statfield.addNewDiscrStats();
                int index = histogram_maxfrequency[i];
                discrStats.setModalValue(histogram_values[i].get(index).toString());
            }
            else
           
                if (interval[i]!=null)
                {
View Full Code Here

                int countValue = histogram_values[i].size();
                Value value = dataFields[i].addNewValue();
                for(int j=0; j<countValue; j++)
                {
                    value.setValue(histogram_values[i].get(j).toString());
                    Extension ext = value.addNewExtension();
                    ext.setName("count");
                    ext.setValue(String.valueOf(histogram_frequency[i][j]));
                }
            }
        }       
        pmmlObject.setDataDictionary(mPMML.getDataDictionary());
        pmmlObject.getDataDictionary().setDataFieldArray(dataFields);
               
        //ModelStat
        MiningModel miningModel = pmmlObject.addNewMiningModel();
        miningModel.setModelName("Statistica");
        org.dmg.pmml31.ModelStatsDocument.ModelStats modelStats =
            miningModel.addNewModelStats();
       
        for(int i=0; i<columnCount; i++)
        {
            UnivariateStats statfield = modelStats.addNewUnivariateStats();
            statfield.setField(colInfo[i].getName());
            // Counts
            Counts counts = statfield.addNewCounts();
            BigInteger pom = new BigInteger(String.valueOf(totalFreq[i]));
            counts.setTotalFreq(pom);
            pom = new BigInteger(String.valueOf(missingData[i]));
            counts.setMissingFreq(pom);
            pom = new BigInteger(String.valueOf(invalidFreq[i]));
            counts.setInvalidFreq(pom);           
            Extension ext = counts.addNewExtension();
            ext.setName("distinctValues");
            ext.setValue(String.valueOf(distinctValue[i]));
           
            //DiscrStats
            OPTYPE.Enum optype = mPMML.getDataDictionary().getDataFieldArray(i).getOptype();
            if(optype == OPTYPE.CATEGORICAL)
            {
                DiscrStats discrStats = statfield.addNewDiscrStats();
                int index = histogram_maxfrequency[i];
                discrStats.setModalValue(histogram_values[i].get(index).toString());
            }
            else
           
                if (interval[i]!=null)
                {
                    NumericInfo numInfo = statfield.addNewNumericInfo();
                    numInfo.setMinimum(minimum[i]);
                    numInfo.setMaximum(maximum[i]);
                    numInfo.setMean(mean[i]);
                    numInfo.setStandardDeviation(stddev[i]);               
                   
                    // ContStats                                                               
                    ContStats contsStats = statfield.addNewContStats();
                    contsStats.setTotalValuesSum(sum[i]);
                    contsStats.setTotalSquaresSum(sum2[i]);  
                                       
                    int intervalCount = interval[i].length;
                    for(int index=0; index<intervalCount; index++)
                    {
                        org.dmg.pmml31.IntervalDocument.Interval interv =
                            contsStats.addNewInterval();
                        interv.setLeftMargin(interval[i][index].getLeftMargin());
                        interv.setRightMargin(interval[i][index].getRightMargin());
                       
                        interv.setClosure(
                                Closure.Enum.forString(
                                        interval[i][index].getClosureName()));
                       
                        Extension extension = interv.addNewExtension();
                        extension.setName("Frequencies");
                        extension.setValue(String.valueOf(interval_frequency[i][index]));
                        extension = interv.addNewExtension();
                        extension.setName("SumOfValues");
                        extension.setValue(String.valueOf(interval_sumofvalues[i][index]));
                        extension = interv.addNewExtension();
                        extension.setName("SumOfSquaredValues");
                        extension.setValue(String.valueOf(interval_squaresum[i][index]));
                    }
                }
                else
                {
                    statfield.setNumericInfo(
View Full Code Here

            pom = new BigInteger(String.valueOf(totalFreq[i]));
            counts.setTotalFreq(pom);
            pom = new BigInteger(String.valueOf(missingData[i]));
            counts.setMissingFreq(pom);
           
            Extension ext = counts.addNewExtension();
            ext.setName("distinctValues");
            ext.setValue(String.valueOf(hashSet[i].size()));
           
            String colType = colInfo[i].getDataType();
            if (colType.equalsIgnoreCase("integer")||
                colType.equalsIgnoreCase("float")||
                colType.equalsIgnoreCase("double"))
View Full Code Here

TOP

Related Classes of org.dmg.pmml31.NumericInfoDocument.NumericInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.