PCA ค้นหาองค์ประกอบได้อย่างไร
ทำความเข้าใจทิศทางความแปรปรวนอย่างเป็นธรรมชาติ
PCA ค้นหาองค์ประกอบได้อย่างไร เป็นบทเรียน Data Science Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Data Science Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Data Science Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Variance Is Information
PCA starts from one idea: the directions where your data spreads most carry the most information. That spread is called variance.
Find the Biggest Spread
PCA hunts for the single axis along which points vary the most. That direction becomes the first principal component.
Then Go Perpendicular
The next axis must be at right angles to the first while capturing the most remaining spread. Each new component is orthogonal to the others.
Components Are New Axes
Together these directions form a fresh coordinate system. Each principal component is a blend of your original features, not just one column.
Ranked by Importance
PCA orders components by how much variance each captures, so the first few hold the bulk of the signal and the last few hold mostly noise.
Project Onto Components
To shrink your data you project it onto the top components, swapping many original columns for a few informative scores.
Explained Variance Ratio
The explained variance ratio tells you the fraction of total spread each component keeps, so you can see how much you save.
Fit It in scikit-learn
In scikit-learn you set how many components you want, then fit_transform turns your wide table into compact scores.
from sklearn.decomposition import PCA
scores = PCA(n_components=2).fit_transform(X)Read the Ratios
After fitting, check explained_variance_ratio_ to see how much each component kept. Summing them shows your total retained variance.
pca = PCA(n_components=2).fit(X)
print(pca.explained_variance_ratio_)Components Are Linear
Each component is a weighted sum of features, so PCA only captures linear structure. Curved patterns need other tools.
Compression, Not Magic
You trade a little accuracy for far fewer columns. Dropped components hold the least variance, so the loss is usually small.
Quick Check
One rule decides which direction PCA picks first.
Recap
PCA finds orthogonal axes of maximum variance, ranks them, and projects data onto the top ones to compress it. 🎯
คำถามที่พบบ่อย
บทเรียน “PCA ค้นหาองค์ประกอบได้อย่างไร” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “PCA ค้นหาองค์ประกอบได้อย่างไร” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Data Science Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Data Science Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “PCA ค้นหาองค์ประกอบได้อย่างไร”
ทำความเข้าใจทิศทางความแปรปรวนอย่างเป็นธรรมชาติ คุณปฏิบัติ Data Science Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Data Science Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Data Science Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน
บทเรียน “PCA ค้นหาองค์ประกอบได้อย่างไร” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Data Science Academy นี้ได้ไหม
ได้ บทเรียน Data Science Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- คำสาปของคุณลักษณะที่มากเกินไป
- PCA ค้นหาองค์ประกอบได้อย่างไร
- ปรับสเกลก่อน แล้วจึงปรับ PCA
- เลือกองค์ประกอบด้วยกราฟ Scree