ใช้ Seaborn visualize ข้อมูล ต้องเช็ค multicollinearity สำหรับ regression ข้อมูลจริงมัก non-linear ต้อง fit โมเดล ใช้ Anscombe's dataset lmplot ใช้กับ non-linear data
ตัวอย่าง
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
my_df = sb.load_dataset('anscombe')
sb.lmplot(x="x", y="y", data=my_df.query("dataset == 'I'"))
plt.show()
ผลลัพธ์

คำอธิบาย
- นำเข้าแพ็กเกจ
- โหลดข้อมูล 'anscombe' จาก seaborn
- เก็บใน DataFrame
- ใช้ 'lmplot' visualize dataset I
- ระบุ dataframe, x, y
- แสดงผล
Anscombe's quartet: 4 datasets ที่มีสถิติคล้ายกันแต่รูปร่างต่างกัน แสดงความสำคัญของการ visualize