จะเห็นว่าตอนที่แกน y ใกล้ 0 มาก ๆ หรือว่าข้อมูลส่วนใหญ่เป็น negative class โมเดลมันมักจะทำนาย prob ที่ต่ำกว่าความเป็นจริง หรือก็คือมั่นใจเกินเหตุว่าจะเป็น negative class
แต่พอค่าแกน y ใกล้ ๆ 1 โมเดลมันก็ทำนายสูงกว่าความเป็นจริงอีก ก็คือมั่นใจเกินเหตุว่าจะเป็น positive class
เส้นสีแดงที่เป็น s shape นั้นแสดงถึงอาการ under-confidence จะเห็นได้ว่า
ตอนที่แกน y ใกล้ 0 มาก ๆ หรือว่าส่วนใหญ่ข้อมูลเป็น negative class โมเดลมันจะไปทำนาย prob สูงกว่าความเป็นจริง → หรือก็คือไม่มั่นใจว่าจะเป็น negative class (เช่น ตอนที่ y อยู่ในช่วง 0.0-0.1 มันทำนาย prob อยู่ในช่วง 0.0-0.4 )
แต่พอค่าแกน y ใกล้ 1 มาก ๆ โมเดลมันจะไปทำนายต่ำกว่าความเป็นจริง → ไม่มั่นใจว่าจะเป็น positive class
โดยที่เราสามารถปรับ probability ให้ตรงกับความเป็นจริงได้ด้วยการทำ probability calibration นั่นเอง โดยการทำ probability calibration นั้นจะนับว่าเป็นการทำ post processing หรือเป็นกระบวนการที่เกิดขึ้นหลังจากเรา train AI model เรียบร้อยแล้ว ซึ่งการทำ probability calibration นั้นควรจะทำบน validation set เนื่องจากว่าบน training set นั้นมีโอกาสที่ model เราจะ overconfidence อยู่แล้ว เพราะมันเคยเห็นคำตอบมาก่อนหน้าแล้ว โดยที่การทำ probability calibration นั้นจะมี algorithm อยู่หลายอันด้วยกัน แต่ในบทความนี้จะยกตัวอย่างสองวิธี ได้แก่ platt scaling และ isonotic regression
Platt Scaling
ใช้เมื่อกราฟ reliability curve ของโมเดลหน้าตาเหมือน sigmoid function (เส้นสี xxx ในภาพที่ xxx ด้านบน) ซึ่งโดยตั้งต้นแล้วตัวมันเองก็ถูกคิดค้นขึ้นมาเพื่อ map ระหว่างผลลัพธ์ของโมเดล SVM (ที่มีค่าระหว่าง -inf ไปถึง +inf) ไปเป็น probability (ที่มีค่าระหว่าง 0 ถึง 1) ซึ่งถ้าเราคุ้นเคยกับการใช้งานแบบนี้มาก่อนจะนึกได้ว่าที่จริงมันคือ sigmoid function เลยนี่นา ซึ่งถ้าพูดให้ถูกตัว Platt scaling มันเหมือน sigmoid function ที่เป็นสามารถเรียนรู้จากข้อมูลได้ โดยจะเห็นได้ว่าสมการของมันจะมีหน้าตาที่คล้าย sigmoid function พอสมควร
โดยจากสมการนั้น
คือโมเดล machine learning เรา เช่น support vector classifier ที่ให้ผลลัพธ์เป็น probability ที่ยังไม่ calibrated
คือผลลัพธ์ probability หลังการ calibrate แล้ว
และ คือ parameter ที่ได้จากการเรียนรู้บนข้อมูล validation set โดยที่การเรียนรู้ค่า และ นั้นจะใช้ gradient descent เพื่อ minimize ค่า binary cross entropy loss
จากภาพอาจจะพอทำให้เห็นภาพได้ว่าทำไมเราจึงต้องการข้อมูลจำนวนมากเพื่อ fit isotonic regression จะเห็นได้ว่าถ้าหากมีจำนวนข้อมูลน้อยเราอาจจะแบ่งออกมาสร้างได้ไม่กี่ bin ตัวบันไดเราก็จะมีไม่กี่ขั้นแล้วก็ไม่ค่อย smooth นั่นเอง
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.