当前位置: 首页>>代码示例>>Python>>正文


Python SSUtilities.writePVal方法代码示例

本文整理汇总了Python中SSUtilities.writePVal方法的典型用法代码示例。如果您正苦于以下问题:Python SSUtilities.writePVal方法的具体用法?Python SSUtilities.writePVal怎么用?Python SSUtilities.writePVal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SSUtilities的用法示例。


在下文中一共展示了SSUtilities.writePVal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createCoefficientReport

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import writePVal [as 别名]
    def createCoefficientReport(self):
        """Creates a formatted summary table of the OLS
        coefficients."""

        #### Table Title ####
        header =  ARCPY.GetIDMessage(84075)
        aFoot = ARCPY.GetIDMessage(84080)
        bFoot = ARCPY.GetIDMessage(84086)
        cFoot = ARCPY.GetIDMessage(84103)
        coefColLab = ARCPY.GetIDMessage(84049) + " " + aFoot
        probColLab = ARCPY.GetIDMessage(84055) + " " + bFoot
        robColLab = ARCPY.GetIDMessage(84102) + " " + bFoot
        vifColLab = ARCPY.GetIDMessage(84284) + " " + cFoot

        #### Column Labels ####
        total = [[ARCPY.GetIDMessage(84068), coefColLab,
                  ARCPY.GetIDMessage(84051), ARCPY.GetIDMessage(84053),
                  probColLab, ARCPY.GetIDMessage(84097),
                  ARCPY.GetIDMessage(84101), robColLab]]

        if self.vif:
            total[0].append(vifColLab)

        #### Loop Through Explanatory Variables ####
        for row in xrange(self.k):
            #### Variable Name ####
            rowVals = [self.varLabels[row]]

            #### Standard Values ####
            rowVals.append(UTILS.formatValue(self.coef[row, 0]))
            rowVals.append(UTILS.formatValue(self.seCoef[row]))
            rowVals.append(UTILS.formatValue(self.tStats[row]))
            rowVals.append(UTILS.writePVal(self.pVals[row], padNonSig = True))

            #### Robust Values ####
            rowVals.append(UTILS.formatValue(self.seCoefRob[row]))
            rowVals.append(UTILS.formatValue(self.tStatsRob[row]))
            rowVals.append(UTILS.writePVal(self.pValsRob[row],
                                           padNonSig = True))

            #### VIF ####
            if self.vif:
                if row == 0:
                    rowVIF = ARCPY.GetIDMessage(84092)
                else:
                    rowVIF = self.vifVal[(row - 1)]
                    if abs(rowVIF) > 1000:
                        rowVIF = "> 1000.0"
                    else:
                        rowVIF = LOCALE.format("%0.6f", rowVIF)
                rowVals.append(rowVIF)

            #### Append Row to Result List ####
            total.append(rowVals)

        #### Finalize Coefficient Table ####
        self.coefTable = UTILS.outputTextTable(total, header = header,
                                               pad = 1, justify = "right")
        self.coefRaw = total
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:61,代码来源:OLS.py

示例2: createDiagnosticReport

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import writePVal [as 别名]
    def createDiagnosticReport(self):
        """Creates a formatted summary table of the OLS
        diagnostics."""

        #### Create PValue Array ####
        allPVals = NUM.array( [self.fProb, self.waldProb,
                               self.BPProb, self.JBProb] )

        #### Check For Any Significance for Extra Padding ####
        signFlag = NUM.any(allPVals <= 0.05)

        #### Table Title ####
        header = ARCPY.GetIDMessage(84076)
        feet = [84104, 84105, 84106, 84107]
        feet = [ ARCPY.GetIDMessage(i) for i in feet ]
        dFoot, eFoot, fFoot, gFoot = feet
        dFoot = ARCPY.GetIDMessage(84104)

        row1 = [UTILS.addColon(ARCPY.GetIDMessage(84253)),
                self.ssdo.inName,
                '  ' + UTILS.addColon(ARCPY.GetIDMessage(84254)),
                UTILS.padValue(self.depVarName, significant = signFlag)]

        aiccLab = ARCPY.GetIDMessage(84251) + " " + dFoot
        row2 = [UTILS.addColon(ARCPY.GetIDMessage(84093)),
                str(self.n), '  ' + UTILS.addColon(aiccLab),
                UTILS.padValue(UTILS.formatValue(self.aicc),
                               significant = signFlag)]

        r2Lab = ARCPY.GetIDMessage(84019) + " " + dFoot
        adjR2Lab = ARCPY.GetIDMessage(84022) + " " + dFoot
        row3 = [UTILS.addColon(r2Lab), UTILS.formatValue(self.r2),
                '  ' + UTILS.addColon(adjR2Lab),
                UTILS.padValue(UTILS.formatValue(self.r2Adj),
                               significant = signFlag)]

        fdofLab = ARCPY.GetIDMessage(84028)
        fLab = ARCPY.GetIDMessage(84025) + " " + eFoot
        row4 = [UTILS.addColon(fLab), UTILS.formatValue(self.fStat),
                "  " + UTILS.addColon(fdofLab.format(self.q, self.dof)),
                UTILS.writePVal(self.fProb, padNonSig = True)]

        chiMess = ARCPY.GetIDMessage(84034)
        wLab = ARCPY.GetIDMessage(84031) + " " + eFoot
        row5 = [UTILS.addColon(wLab), UTILS.formatValue(self.waldStat),
                "  " + UTILS.addColon(chiMess.format(self.q)),
                UTILS.writePVal(self.waldProb, padNonSig = True)]

        kLab = ARCPY.GetIDMessage(84037) + " " + fFoot
        row6 = [UTILS.addColon(kLab), UTILS.formatValue(self.BP),
                '  '+ UTILS.addColon(chiMess.format(self.q)),
                UTILS.writePVal(self.BPProb, padNonSig = True)]

        jbLab = ARCPY.GetIDMessage(84043) + " " + gFoot
        row7 = [UTILS.addColon(jbLab), UTILS.formatValue(self.JB),
                '  '+ UTILS.addColon(chiMess.format(2)),
                UTILS.writePVal(self.JBProb, padNonSig = True)]

        #### Finalize Diagnostic Table ####
        diagTotal = [ row1, row2, row3, row4, row5, row6, row7 ]
        diagJustify = ["left", "right", "left", "right"]

        self.diagTable = UTILS.outputTextTable(diagTotal,
                                header = header, pad = 1,
                                justify = diagJustify)
        self.diagRaw = diagTotal
        self.diagJustify = diagJustify
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:69,代码来源:OLS.py


注:本文中的SSUtilities.writePVal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。