การกระจายตัวของแต่ละ Feature แบ่งตาม Class (0 กับ 1)
คนอายุเยอะมีโอกาส churn สูงกว่า
ลูกค้าที่ balance สูงก็ churn มาก
ลูกค้า Germany มี churn rate สูงกว่า France/Spain
เพศหญิง churn rate สูงกว่าเพศชายเล็กน้อย
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
เมื่อเราได้ Model แล้วขั้นตอนต่อมาคือเอาไป Fit กับ Test Set ที่เรา Split ไว้ตอนแรก
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ต่อไปคือการเอา y_pred ที่เราทำนายได้ ไปเทียบกับ y_test ซึ่งคือค่าจริงๆของมัน เพื่อดูว่า model ของเราทายถูก/ผิด เท่าไหร่
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simulation based on 1,000,000 people:
Total people who tested 'Positive': 19,891
People who are actually sick AND tested 'Positive': 9,933
------------------------------
The probability of being sick given a positive test is: 0.4994
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ยิ่ง Sample เข้าใกล้ Population เท่าไหร่ Result ยิ่ง Accuracy มากขึ้น แต่ Sampling ในการทำงานถูกจำกัดอยู่ 2 อย่าง คือ Budget and Time
Sampling’s Method
แบ่งออกเป็น Probability Sampling และ Non-probability Sampling
Probability Sampling 🎲 (Efficient ที่สุด)
Simple random sampling การสุ่มที่ต้องทำในระบบปิดคือที่ต้องมีรายชื่อประชากรทั้งหมดก่อน ทุกๆคนจะมีโอกาศถูกสุ่มได้เท่าๆกัน เช่น ล๊อตตารี่
Systematic random sampling สุ่มแบบเป็นระบบเช่น สุ่ม1เว้น2 เป็นต้น คือเราต้องกำหนด Rule Base ในการเลือกกลุ่มตัวอย่าง
Cluster random sampling แบ่ง Population ออกเป็น Cluster
Stratified random sampling (ใช้ในงาน Market research) Step แบ่ง Population ออกเป็น Region (และใช้ random sampling ใน region นั้นๆอีกที) → Survey ตามพื้นที่ → สรุปผล
Non-Probability Sampling
Convenience ส่วนใหญ่ นักศึกษาใช้วิธีนี้ซึ่งไม่สามารถ Represent ประชากรทั้งหมดได้ เพราะ ข้อมูลจะอยู่กระจุกอยู่ที่ส่วนใดส่วนหนึ่งของทั้งหมด เช่น ออกแบบสอบถามใน google form ส่งให้เพื่อนช่วยทำ เป็นต้น
Snowball Sampling เช่น สำรวจคนที่ซื้องาช้าง จะได้กลุ่มคนที่เหมือนๆกัน high bias แต่อย่างน้อยก็มีข้อมูล เช่นถามคนที่รู้จักกันแล้วเซอเวย์คนนี้ต่อๆเป็นทอดๆ
นักสถิติสมัยก่อนเวลาเก็บรวบรวมกลุ่มตัวอย่างขึ้นมาแต่ละรอบนั้นค่อนข้างลำบากเลยเกิดทฤษฎีที่มีชื่อว่า Central Limit Theorem ขึ้นมาเพื่อเป็นการบอกว่าถ้าเราทำการทดลองซ้ำไปเรื่อยๆและพล๊อตเป็นกราฟ ค่าเฉลี่ยที่ได้จะเข้าใกล้ค่าเฉลี่ยของประชากรหรือค่าเฉลี่ยที่แท้จริง(Mean Population) ทฤษฏีนี้เป็นแกนหลักของสถิติแบบ Frequentist
Central Limit theorem
Central Limit theorem (CLT)บอกว่าถ้าเกิดเราสุ่ม Sample ออกมาจาก Population หรือที่เรียกว่า Resampling ซ้ำหลายๆครั้งแล้วนำผลลัพท์ที่ได้จากการ Resampling มาพล๊อตเป็นกราฟ Sampling Distribution ที่ได้จะเป็น Normal Distribution ไม่ว่า Population นั้นๆจะมี Distribution แบบไหนก็ตาม
โดย Satisfy กฏอย่างน้อย 2 ข้อนี้
Sample size >= 30 ขนาดกลุ่มตัวอย่างต้องมากกว่า30
Random Sampling ต้องเป็นไปในแบบสุ่ม
Descriptive Statistic
1. Central Tendency
have only tree parameter to measure center of normal distribution curve center.
Mean
Median (A robust stat mean that outlier does not affect median)
Mode
2. Measure Of Spread
Is used to know spread between x that how far from mean
SD
Variance
Range (Max-Min)
IQR
Boxplot มี 3 Quarter ซึ่งวัดจาก Percentile ของ Index of dataset
Leave a Reply