Vẽ biểu đồ insight của biến dự đoán

Nhập môn Phân tích Dự đoán với Python

Nele Verbiest, Ph.D

Data Scientist @PythonPredictions

Biểu đồ insight của biến dự đoán

Nhập môn Phân tích Dự đoán với Python

Vẽ tỷ lệ xuất hiện của mục tiêu

import matplotlib.pyplot as plt
import numpy as np

# Vẽ biểu đồ pig_table["Incidence"].plot()
# Hiển thị tên nhóm plt.xticks(np.arange(len(pig_table)), pig_table["income"])
# Căn giữa tên nhóm width = 0.5 plt.xlim([-width, len(pig_table)-width])
plt.ylabel("Incidence", rotation = 0, rotation_mode="anchor", ha = "right") plt.xlabel("Income") plt.show()

Nhập môn Phân tích Dự đoán với Python

Vẽ kích thước

import matplotlib.pyplot as plt
import numpy as np
# Vẽ biểu đồ

plt.ylabel("Size", rotation = 0,rotation_mode="anchor", ha = "right" )
pig_table["Incidence"].plot(secondary_y = True)
pig_table["Size"].plot(kind='bar', width = 0.5, color = "lightgray", edgecolor = "none") ## Thêm cột
# Hiển thị tên nhóm plt.xticks(np.arange(len(pig_table)), pig_table["income"]) # Căn giữa tên nhóm plt.xlim([-0.5, len(pt)-0.5]) plt.ylabel("Incidence", rotation = 0, rotation_mode="anchor", ha = "right" plt.xlabel("Income") plt.show()
Nhập môn Phân tích Dự đoán với Python

Vẽ kích thước

Nhập môn Phân tích Dự đoán với Python

Cùng luyện tập nào!

Nhập môn Phân tích Dự đoán với Python

Preparing Video For Download...