- Python 資料科學教程
- Python 資料科學 - 首頁
- Python 資料科學 - 入門
- Python 資料科學 - 環境設定
- Python 資料科學 - Pandas
- Python 資料科學 - Numpy
- Python 資料科學 - SciPy
- Python 資料科學 - Matplotlib
- Python 資料處理
- Python 資料操作
- Python 資料清洗
- Python 處理 CSV 資料
- Python 處理 JSON 資料
- Python 處理 XLS 資料
- Python 關係資料庫
- Python NoSQL 資料庫
- Python 日期和時間
- Python 資料整理
- Python 資料聚合
- Python 讀取 HTML 頁面
- Python 處理非結構化資料
- Python 單詞標記化
- Python 詞幹提取和詞形還原
- Python 資料視覺化
- Python 圖表屬性
- Python 圖表樣式
- Python 箱形圖
- Python 熱力圖
- Python 散點圖
- Python 氣泡圖
- Python 3D 圖表
- Python 時間序列
- Python 地理資料
- Python 圖形資料
Python - 相關性
相關性是指涉及兩個資料集之間的依賴性的某些統計關係。依賴性現象的簡單示例包括父母與其後代的身體外貌之間的相關性,以及產品的價格與其供應量之間的相關性。
我們以 seaborn Python 庫中的 iris 資料集為例。我們嘗試建立三種鳶尾屬花卉萼片和花瓣的長度和寬度之間的相關性。基於發現的相關性,可以建立一種強大的模型,可以輕鬆地區分一種物種與另一種物種。
import matplotlib.pyplot as plt
import seaborn as sns
df = sns.load_dataset('iris')
#without regression
sns.pairplot(df, kind="scatter")
plt.show()
它的輸出為:-
廣告