首页 > 分享 > pearson相关系数算法

pearson相关系数算法

最新推荐文章于 2024-10-24 03:14:56 发布

置顶 我是花哥 于 2018-10-30 15:07:47 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

#-*- coding: utf-8 -*- #计算两两指标间的相关系数矩阵 import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns inputfile = 'data3.csv' #输入的数据文件 data = pd.read_csv(inputfile) #读取数据 pearson=np.round(data.corr(method = 'pearson'), 2) #计算相关系数矩阵,保留两位小数 print(pearson) pearson.to_csv("data.csv") #热力图 colormap = plt.cm.viridis plt.figure(figsize=(30,30)) plt.title('Unit_price Correlation of Features', y=1.05, size=15) sns.heatmap(data.astype(float).corr(),linewidths=0.1,vmax=1.0, square=True, cmap=colormap, linecolor='white', annot=True) plt.show()

相关知识

Impact of the population ratio between pest and predator on the competitive effect index among predators: taking Frankliniella intonsa and their major natural enemies as an example
Niche and interspecific association of main species in shrub layer of Cyclobalanopsis glauca community in karst hills of Guilin, southwest China
小兴安岭红松日径向变化及其对气象因子的响应
基于超市商品补货策略的分析——以2023年全国数学建模竞赛C题为例
作物种植前后土壤有机质及养分因子的空间变异分析
多花菊花色分类及色彩空间值与色素的相关性
旱作条件下保护性耕作对土壤结构和容重影响试验研究
鲜花分类算法
伏牛山栓皮栎群落优势种群种间关联动态分析
js植物算法

网址: pearson相关系数算法 https://m.huajiangbk.com/newsview795230.html

所属分类:花卉
上一篇: 代码中的一个分号,引发程序员的疯
下一篇: 单身狗们,举起爪子,光棍节发起反