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


Python DataSet.correlation方法代码示例

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


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

示例1: Root

# 需要导入模块: from dataset import DataSet [as 别名]
# 或者: from dataset.DataSet import correlation [as 别名]

#.........这里部分代码省略.........
            data.split(target_column_name = self.configCV['target_value'], test_set_size = self.configCV['test_set_size'], seed = self.configCV['seed'], random_state_is = self.configCV['random_state_is'])
            self.output_str("Finished splitting the data.")
            self.feedback("Succesfully split the data.")
            self.update_overview(trainrows=len(data.X_train),testrows=len(data.X_test),ncols=len(data.X_train.columns.values))
            self.split = True
        else:
            self.feedback("Please load a dataset.")







    """
    Coarse Statistics
    """

    def menu_coarse_statistics(self):
        if self.loaded:
            desc = data.descstats(write=False)
            self.output_str("Coarse statistics finished.")
            self._output_last(desc)
            location = self.write_output(desc, filename='Coarse-Statistics.csv')
            self.feedback("Descriptive statistics calculated. Results written to file: " + str(location))
        else:
            self.feedback('Please load a dataset.')

    """
    Variable Correlations
    """
    def menu_var_corr(self):
        if self.loaded & self.split:
            correlation, descstats, df = data.correlation()
            location = self.write_output(df,"Correlations.csv")
            self._output_last(df)
            column_a_b = df['Var1']
            column_a_b = column_a_b.append(df['Var2'])
            top_vars = column_a_b.value_counts()

            string = """
======  ======  =======  ======
Var1    Var2     Corr     p
            """
            for index, row in df.iterrows():
                string += """
------  ------  -------  ------
%s       %s    %0.3f     %0.1f
                """ % (row['Var1'],row['Var2'],row['Correlation'],row['P-Value'])
            string += """
======  ======  =======  ======
            """
            self._output_last(string)
            self.feedback("Variable correlations calculated. Results written to file: " + location)
        else:
            if self.loaded is False:
                self.feedback("Please load a dataset.")
            elif self.split is False:
                self.feedback("Please split the data set into training and validation sets.")

    """

    Find the best features leading to a better AUC with NBN

    """
开发者ID:Dismeth,项目名称:gui,代码行数:69,代码来源:main.py


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