本文整理汇总了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
"""