<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by SUNG on Medium]]></title>
        <description><![CDATA[Stories by SUNG on Medium]]></description>
        <link>https://medium.com/@pariyanuchprasertsirikul?source=rss-5c168caa7ce3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0P9lJNw6eEqGZwVUmXERlA@2x.jpeg</url>
            <title>Stories by SUNG on Medium</title>
            <link>https://medium.com/@pariyanuchprasertsirikul?source=rss-5c168caa7ce3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:14:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pariyanuchprasertsirikul/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[อนุมัติปล่อยสินเชื่อให้ลูกค้าดีหรือไม่ ก็ทำนายด้วย Machine Learning]]></title>
            <link>https://pariyanuchprasertsirikul.medium.com/%E0%B8%AD%E0%B8%99%E0%B8%B8%E0%B8%A1%E0%B8%B1%E0%B8%95%E0%B8%B4%E0%B8%9B%E0%B8%A5%E0%B9%88%E0%B8%AD%E0%B8%A2%E0%B8%AA%E0%B8%B4%E0%B8%99%E0%B9%80%E0%B8%8A%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B8%A5%E0%B8%B9%E0%B8%81%E0%B8%84%E0%B9%89%E0%B8%B2%E0%B8%94%E0%B8%B5%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD%E0%B9%84%E0%B8%A1%E0%B9%88-%E0%B8%81%E0%B9%87%E0%B8%97%E0%B8%B3%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-machine-learning-1d298b5eab8f?source=rss-5c168caa7ce3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d298b5eab8f</guid>
            <dc:creator><![CDATA[SUNG]]></dc:creator>
            <pubDate>Sat, 08 May 2021 15:49:20 GMT</pubDate>
            <atom:updated>2021-05-10T07:11:22.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*JEj_5WV8zlFoXJIu" /><figcaption><a href="https://datahack.analyticsvidhya.com/contest/practice-problem-loan-prediction-iii/">Loan Prediction (analyticsvidhya.com)</a></figcaption></figure><p>สวัสดีค่า ❤ บทความนี้เป็น Project ที่ร่วมงานกับเพื่อน sidth รายวิชา Machine Learning ของหลักสูตรวิทยาศาสตรมหาบัณฑิต สาขาวิทยาการข้อมูล หัวข้อ Loan Prediction นะคะ เป็นข้อมูลลูกค้าที่ทำการขอสินเชื่อ จะทำนายว่าบริษัทปล่อยสินเชื่อให้ลูกค้าดีหรือไม่ และส่งตรวจสอบคะแนนความแม่นยำของข้อมูลที่เราทำนายโดยใช้ Analytics Vidhya</p><p>บริษัทที่ให้เช่าในการขอสินเชื่อ มักมีกฎในการปล่อยสินเชื่อที่เข้มงวด เนื่องด้วยในปัจจุบันหนี้มีแนวโน้มที่เพิ่มขึ้นทุกวัน ทำให้บริษัทจำเป็นต้องให้ความสำคัญในการพิจารณาปล่อยสินเชื่ออย่างรอบคอบ รัดกุมที่สุดเท่าที่เป็นไปได้</p><p>ก่อนที่บริษัทจะอนุมัติเงินกู้ให้กับลูกค้า บริษัทมักตรวจสอบประวัติการชำระสินเชื่อต่างๆ เนื่องจากต้องการให้ลูกค้าผ่อนชำระสินเชื่อคืนได้ตามกำหนด หากมีชื่อลูกค้าขึ้นในเครดิตว่ามีการค้างชำระ บริษัทอาจจะอนุมัติเงินกู้ให้ลูกค้าได้ยาก หรืออาจจะไม่อนุมัติให้</p><p>ในที่นี้ Case ก็คือ บริษัท Dream Housing Finance ต้องการได้กำไรจากการที่ได้รับอัตราดอกเบี้ยเงินกู้จากลูกค้าที่จ่ายผ่อนชำระได้ตามกำหนด เพื่อให้บริษัทไม่ได้รับผลกระทบวงเงินที่อนุมัติ เลยใช้ข้อมูลลูกค้าที่สมัครสินเชื่อในแบบฟอร์มมาช่วยพิจารณาว่า ลูกค้ามีความน่าเชื่อถือที่จะได้รับสินเชื่อเงินกู้มากน้อยเพียงใดจากข้อมูลลูกค้า เช่น เพศ, สถานภาพการสมรส, การศึกษา, จำนวนผู้อุปการะ, รายได้, จำนวนเงินกู้, ประวัติเครดิต และอื่น ๆ</p><blockquote>Predictor: ข้อมูลแบบฟอร์มสมัครขอสินเชื่อ</blockquote><blockquote>Target: ลูกค้าจะได้รับอนุมัติสินเชื่อหรือไม่</blockquote><p>Dataset มี 2 ไฟล์ ประกอบด้วย training set กับ test set สามารถ download ได้ที่</p><p><a href="https://datahack.analyticsvidhya.com/contest/practice-problem-loan-prediction-iii/">https://datahack.analyticsvidhya.com/contest/practice-problem-loan-prediction-iii/</a></p><p>ท่านผู้อ่านค่อยๆ ทำความเข้าใจ dataset นะคะ แค่ดูว่าหน้าตาข้อมูลเป็นยังไง มี feature อะไรบ้าง จำนวนเท่าไร มีกี่ row มีค่า null หรือไม่ มากน้อยแค่ไหน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*IuVUL7HNN4I_ynkW" /></figure><p>Metadata ของ feature ต่างๆ ของข้อมูล loan prediction</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*WLstwOK-fALSeIK0" /></figure><p>เห็นแล้วว่าข้อมูลนี้มี 13 features ค่อนข้างเยอะ จำนวนกลุ่มตัวอย่างไม่ค่อยเยอะ 614 แถว มีบาง feature ที่ไม่มีค่า null ด้วย และพบว่ามีข้อมูล 2 ประเภท คือ categorical feature กับ numerical feature</p><p>ขั้นตอนต่อไปก็คือ สำรวจข้อมูลต่างๆ (EDA) ดังนี้</p><p>เริ่มที่ Target = Loan_Status เป็น Categorical data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*IVQ7VVJlBTQP4vcV" /></figure><p>ต่อไปสำรวจ Predictor ที่เป็น Categorical Feature ได้แก่ Gender, Married, Dependents, Education, Self_Employed, Credit_History, Property_Area</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*b0J61kWsTA-mHq5H" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*5DFQEPwiTcQw1R7w" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*OODoGPQ3hBpYe7xn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*xNgf4RmtEUJyk-T5" /></figure><p>ทุกกราฟมีคนที่ได้รับอนุมัติกู้ยืม (Y) เยอะกว่าจำนวนคนที่ไม่ได้รับอนุมัติกู้ยืม (N) แทบทุกๆ กรณีแต่ละ feature เพราะว่าเป็น Imbalanced data มีจำนวน Y มากกว่า N เกือบครึ่งหนึ่ง โดยที่จากกราฟด้านบนพบว่า ผู้ยื่นกู้ที่จบการศึกษา แต่งงานโดยที่ยังไม่มีบุตร หรือไม่ต้องอุปการะใคร และมีรายได้เป็นหลักแหล่ง มีโอกาสที่ธนาคารจะปล่อยสินเชื่อให้มากกว่าผู้ยื่นกู้รายอื่น</p><p>ส่วน Predictor ที่เป็น Numerical Features เช่น ApplicantIncome, CoapplicantIncome, LoanAmout Loan, Loan_Amout_Term</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*EtWkKpxEdFgbh1Tk" /></figure><p>จะทำ Handling Missing Value ด้วยเริ่มตรวจสอบจำนวนค่า null แต่ละ feature</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/0*gqw6TQkQ6AeARww3" /></figure><p>พบว่ามี 7 features ที่มีค่า null ได้แก่ Gender, Married, Dependents, Self_Employed, LoanAmount, Loan_Amount_Term, Credit_History ดังนั้น Feature เหล่านี้จะถูกจัดการข้อมูลขาดหาย (missing value) ด้วยการเติมข้อมูลแทน null ดังนี้</p><ol><li>Gender, Married, Dependents, Self_Employed, Credit_History ถูกเติมด้วย ฐานนิยม (Mode) ของ Feature นั้นๆ</li><li>LoanAmount ถูกเติมด้วย ค่าเฉลี่ยที่คำนวณได้</li><li>Loan_Amoun_Term ถูกเติมด้วย มัธยฐาน (Median)</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9576c0751adaff485b77030722e97654/href">https://medium.com/media/9576c0751adaff485b77030722e97654/href</a></iframe><p>ต่อไปทำ Feature engineering ด้วยปรับค่าของ Feature จากข้อความเป็นตัวเลข เช่น สถานะการแต่งงาน (Married) มี 2 สถานะ แต่งแล้ว (Yes) จะเปลี่ยนเป็น 1 ส่วนยังไม่ได้แต่งงาน (No) จะเปลี่ยนเป็น 0 เพื่อให้สะดวกในขั้นตอนการคำนวณ ดังโค้ดด้านล่าง</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f41b6a5e780a25b17bfe93e57eff3ba7/href">https://medium.com/media/f41b6a5e780a25b17bfe93e57eff3ba7/href</a></iframe><p>หลังจากปรับค่าเรียบร้อยแล้วสำรวจข้อมูลอีกครั้งด้วย info พบว่ายังมีบาง feature ที่ยังไม่ได้เป็นชนิดตัวเลข ได้แก่ Gender, Married, Dependents, Credit_History ดังนั้น แปลงชนิดเป็นตัวเลขก่อน</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2e53073e8b5476ed822342c2d846d91/href">https://medium.com/media/b2e53073e8b5476ed822342c2d846d91/href</a></iframe><p>เมื่อปรับค่าของแต่ละ Feature เรียบร้อยแล้ว จึงลองดูว่ามี Feature ใดบ้างที่สอดคล้องกัน โดยหาจากค่า Correlation ดังตารางด้านล่าง พบว่า รายได้ของผู้ยื่นกู้ (ApplicatantIncome) ค่อนข้างสอดคล้องกับ สินเชื่อที่บริษัทรอนุมัติ (LoanAmount) ที่ค่า corr = 0.57 และอีกคู่ที่สอดคล้องกันคือ ประวัติการเงิน (Credit_History) นั้นสอดคล้องกับโอกาสที่จะได้รับสินเชื่อ ที่ค่า corr = 0.54</p><p>สรุปเบื้องต้นได้ว่า ผู้ยื่นกู้ที่มีรายได้มากและมีประวัติการเงินที่น่าเชื่อถือ มีโอกาสที่จะได้รับการปล่อยกู้ในวงเงินที่มากขึ้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HluTN69_IXrEU2Hw6WZatA.png" /></figure><p>บทความนี้จะไม่แบ่งชุดข้อมูลออกมาเพื่อสร้าง Model เนื่องจากข้อมูลที่ได้มานั้นถูกแบ่งออกมาแล้วเรียบร้อย และผลลัพธ์ที่ได้จะส่งให้ Analytic Vidhya ตรวจสอบความถูกต้องของการทำนายต่อไป โดยข้อมูลทดสอบ (Test set) ที่ได้นั้น จะนำมาใช้เพื่อทดสอบ Model ที่สร้างขึ้นก่อนส่งตรวจ</p><p>แต่ก่อนอื่นนั้นแต่จะต้องจัดการข้อมูล test set ก่อนด้วย Handling missing value เช่นเดียวกับ training set ที่เติมค่าฐานนิยม มัธยฐาน ค่าเฉลี่ยของ training set เข้าไปแทนค่า null ของ test set</p><p>ระวังอย่าให้เกิด information leakage กับ test set นะคะ จากการเติมค่าฐานนิยม มัธยฐาน ค่าเฉลี่ย ของ training set ทั้งหมด ไปแทน null ให้ test set ไม่ทำให้เกิด information leakage</p><p>ต่อไปมีการทำ Feature Engineering หลายแบบพร้อมการสร้าง model ต่างๆ สรุปได้ดังตารางด้านล่าง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XoiwriqXORMP6sMw" /></figure><p>เห็นว่า Decision Tree และ Random Forest ได้คะแนน Accuracy เต็มเท่ากับ 1 เนื่องจาก fit กับข้อมูลที่ใช้สร้าง Model มากเกินไป (Overfit) มีโอกาสที่จะรับมือกับข้อมูลอื่น เช่น ข้อมูลที่อยู่ใน Test Set ได้ยาก ส่งผลให้การทำนายค่าใน Test set มีความถูกต้องน้อยตามไปด้วย</p><p>จึงเลือก Model ที่เหมาะสมและได้คะแนน Accuracy มาก (0.863) คือ XGBoost โดยทำ Imputing Missing Value กับ Sum income และ Model ที่เหมาะสมและได้คะแนน Analytics Vidhya มาก (0.799) คือ XGBoost โดยใช้แค่ Imputing Missing value</p><p>ดังนั้น จึงทดลองด้วยการสร้าง XGBoost ด้วยปรับ data ให้ balance / Feature Engineering ด้วย Sum of Income / Tunine Parameter ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*pz7LkmQqXj565rdb" /></figure><p>สรุปได้ว่า Model สำหรับ Accuracy Train มากสุดในทางทฤษฎี คือ XGBoost ที่มีการทำ RandomOver + Sum of 2 Income Feature + Tuning Parameter (0.886)</p><p>ส่วน Model สำหรับคะแนนของ Analytics Vidhya มากสุด คือ XGBoost แบบ Simple (ไม่มีการทำ RandomOver + Sum of 2 Income Feature + Tuning Parameter) มีค่า 0.799</p><p>ต่อไปลองทดลองด้วยการ Feature Selection โดยกำหนดพารามิเตอร์เป็นจำนวน feature ที่เลือก</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*QSGmjgc9zuGR82_6" /></figure><p>พบว่า 11 features ได้คะแนนมากสุด เป็น All feature</p><p>เพราะฉะนั้น คะแนนของ Analytics Vidhya มากสุดที่ได้จากการทดลองหลายแบบมากที่สุดคือ 0.799 โดยเลือก All features โดยไม่มีการรวมรายได้ของ Applicant กับ CoApplicant แล้วสร้าง Model XGBoost ตามโค้ดด้านล่างนะคะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7deeb01f843ddc89c640bf548c1853de/href">https://medium.com/media/7deeb01f843ddc89c640bf548c1853de/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/109cba0f59176cc619d6342f4862321f/href">https://medium.com/media/109cba0f59176cc619d6342f4862321f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39b8aa28fb85aead2596c11fb2f068c0/href">https://medium.com/media/39b8aa28fb85aead2596c11fb2f068c0/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*4CQZG33ltcTqj5RaiSIXCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vHG2LvHNrVaZeOfR" /></figure><p>ส่วนคะแนน Accuracy Train ตามทฤษฎีมากสุดคือ 0.886 ซึ่งเป็นการทำ Feature Engineering ด้วยการรวมรายได้ของ Applicant กับ CoApplicant แล้วสุ่มแบบ RandomOver จากนั้นสร้าง Model XGBoost แล้วไป Tuning Parameter ตามโค้ดด้านล่างค่ะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23c366d400ba0aa05df2d26087d72181/href">https://medium.com/media/23c366d400ba0aa05df2d26087d72181/href</a></iframe><blockquote>**เพิ่มเติม** นี่คือเบื้องหลังการทดสอบแนวคิดก่อนใช้งานจริง</blockquote><p>ขั้นแรกลองปรับ feature engineering ใหม่ด้วยการใส่ฟังก์ชัน log 10 ให้กับ LoanAmount ดังรูปภาพ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*YOIYs1Ym4rj5bipnAcCOaA.png" /><figcaption>ก่อนใส่ฟังก์ชัน log</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*ofLQw-4PC7kBaH7Z3AAYxA.png" /><figcaption>หลังใส่ฟังก์ชัน log</figcaption></figure><p>ส่วนการรวมรายได้ของ ApplicantIncome กับ CoApplicantIncome จะได้หน้าตาแบบนี้ หลังใส่ฟังก์ชัน log10 ดังรูปแนบ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*fq1zlCJnOFbToLDszXegXg.png" /></figure><p><strong>“Decistion Tree” </strong>เป็น Algorithm ที่นิยม ใช้ง่าย เข้าใจง่าย ให้นึกภาพว่า เป็นต้นไม้กลับหัว โดยสิ่งที่อยู่บนสุดคือราก (Root node) ส่วนสิ่งที่ทยอยลง (Child node) มาจนกว่าแตกไม่ได้ นั่นคือใบไม้ (Leaf node) เป็นจุดสิ้นสุด</p><p>สร้างโมเดลด้วยการทำ pipeline ด้วยการใส่ StandardScaler() แล้วต่อด้วย DecisionTreeClassifier() ที่มีพารามิเตอร์ดีที่สุดด้วยการใช้ GridSearch คือ {‘decisiontreeclassifier__criterion’: ‘gini’, ‘decisiontreeclassifier__max_depth’: 5} ได้ Accuracy 0.832 แล้วส่งตรวจคะแนนได้ 0.757 นะคะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/116594fee248c84d5d6539209eee3ae2/href">https://medium.com/media/116594fee248c84d5d6539209eee3ae2/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*BbgR-OCviff7mssqqljtQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*R6TP-oolci8sNghDDf9FwQ.png" /></figure><p>ต่อไป export Decision Tree model โดยกำหนดพารามิเตอร์ที่ดีที่สุดด้วย criterion = ‘gini’, max_depth=5 แล้วทำ visualisation ดังรูปแนบนะคะ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KS3bhdXSyeK858K5b8-bhw.png" /></figure><p>จากนั้นวัดประสิทธิภาพ Model นี้จาก Confusion Martix ซึ่งเป็นตารางสำคัญในการวัดความสามารถของ machine learning ในการแก้ปัญหา classification</p><ol><li>True Positive ( TP ) ทำนายว่า “จริง” และ มีค่าเป็น “ จริง ”</li><li>True Negative ( TN ) ทำนายว่า “ไม่จริง” และ มีค่า “ ไม่จริง ”</li><li>False Positive ( FP ) ทำนายว่า “จริง” แต่ มีค่าเป็น “ไม่จริง”</li><li>False Negative ( FN ) ทำนายว่า “ไม่จริง” แต่ มีค่าเป็น “จริง”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*uEKX6upox77FKwkaZCYLSQ.png" /><figcaption>ทำเป็น Confusion Matrix</figcaption></figure><p>ยังสามารถใช้ Confusion Matrix ตรวจสอบประสิทธิการทำงานของโมเดลว่าดีแค่ไหน ดังนี้</p><ol><li>Precision เป็นการวัดความแม่นยำของข้อมูล = TP / (TP + FP)</li><li>Recall เป็นการวัดความถูกต้องของ Model = TP/(TP+FN)</li><li>Accuracy เป็นการวัดความถูกต้องของ Model = (TP + TN) / (TP+TN+FP + FN)</li><li>F1-Score เป็นค่าเฉลี่ยแบบ harmonic mean ระหว่าง precision และ recall และเป็น single metric ที่วัดความสามารถของโมเดล = 2 x (Precision x Recall)/(Precision + Recall)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*wK54lk9c2HyTZTZNkf_ZKQ.png" /><figcaption>ค่าต่างๆที่ได้จาก Confusion Matrix</figcaption></figure><p><strong>“Naive Bayes” </strong>เป็นการจัดหมวดหมู่โดยใช้หลักความน่าจะเป็นช่วยวิเคราะห์หาความน่าจะเป็นของสิ่งที่ยังไม่เคยเกิดขึ้น โดยการคาดเดาจากสิ่งที่เคยเกิดขึ้นมาก่อน เช่น ต้องการแบ่งกลุ่มว่าจะปล่อยสินเชื่อให้ลูกค้าหรือไม่ แล้วคาดว่าข้อมูลที่ลูกค้ากรอกนั้นมีความน่าจะเป็นที่ลูกค้าได้รับสินเชื่อเท่ากับ 95% P(X|Loan_Status=”Y”) = 0.95 เมื่อ X คือ predictor แต่ละ feature ได้แก่ เพศ, รายได้, การศึกษา</p><p>สร้างโมเดลด้วยการทำ pipeline โดยรัน StandardScaler() แล้วต่อด้วย GaussianNB() ที่มีพารามิเตอร์แบบ Default ได้ Accuracy 0.801 แล้วส่งตรวจได้คะแนน 0.764 นะคะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3381ecf29a59b073618ed5b5d5702d88/href">https://medium.com/media/3381ecf29a59b073618ed5b5d5702d88/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*YVOBvF8F3yoScJXDGYZUCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*aaCWfpVTxkiTbgweDQ1AKA.png" /></figure><p><strong>“Logistic Regression” </strong>เป็น classification model เราต้องการให้ Target คือ Yes หรือ No เท่านั้น โดยสามารถหาความเป็นได้ที่จะได้คำตอบนั้นด้วยการสร้าง Hypothesis function เมื่อได้ function นี้แล้วไปคำนวณเพื่อทำให้ค่าความคลาดเคลื่อนน้อยที่สุดด้วยการอาศัย Cost function และ Gredient function</p><p>มีการสร้าง model ด้วย pipeline โดยใส่ StandardScaler() แล้วต่อด้วย LogisticRegression() ที่มีพารามิเตอร์ดีที่สุดด้วยการใช้ GridSearch คือ {‘logisticregression__C’: 0.01, ‘logisticregression__solver’: ‘newton-cg’} ได้ Accuracy 0.801 แล้วส่งตรวจได้คะแนน 0.778 นะคะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d20ee916a49dfa19d527b90ef896af5/href">https://medium.com/media/1d20ee916a49dfa19d527b90ef896af5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*9-E7rOCkfXBG64CRzWETqA.png" /><figcaption>Max index = 0 จากการใช้คำสั่ง idxmax() ในการหา mean_test_score มากสุด</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*5t6cUUHH3BBf_HXKt0fI7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*58jNq0Sln6lbAGj_SWbxiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*XqQfdwM-EHDlqVy3SgpZzQ.png" /></figure><p><strong>“Support Vector Machines” </strong>เป็น Algorithm ที่ช่วยแก้ปัญหาการจำแนกข้อมูลด้วยการสร้างเส้นแบ่งแยกกลุ่มข้อมูลที่ถูกป้อนเข้าจนเรียนรู้ แล้วเน้นไปยังเส้นแบ่งแยกกลุ่มข้อมูลได้ดีที่สุด</p><p>ทำ model ด้วย pipeline โดยใส่ StandardScaler() แล้วต่อ SVC() ที่มีพารามิเตอร์ดีที่สุดด้วยการใช้ GridSearch คือ {‘svc__C’: 0.1, ‘svc__decision_function_shape’: ‘ovo’, ‘svc__degree’: 3, ‘svc__gamma’: ‘scale’, ‘svc__kernel’: ‘sigmoid’} ได้ Accuracy 0.803 แล้วส่งตรวจได้คะแนน 0.778 นะคะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0104efc67b1194ad1655c15165453181/href">https://medium.com/media/0104efc67b1194ad1655c15165453181/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*RNqmINul8waG0CvVpGGs_w.png" /><figcaption>Max index = 243 จากการใช้คำสั่ง idxmax() ในการหา mean_test_score มากสุด</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*zlWYHFf_zcBZAIiYMdaH1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*Wzj_RW5tf58QdYqSKGLjJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*ybEZhTHv3BXjVSjBHFzIwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*6FEYsiMeGjEfE3WioEqISg.png" /></figure><p>ขอขอบคุณอาจารย์ทุกท่านที่สอนให้ความรู้มากมาย ทำให้ได้เรียนรู้ใหม่ๆเสมอ ขอขอบคุณเพื่อนที่ร่วมงาน project เป็นไปได้ด้วยดี ขอขอบคุณท่านผู้อ่านทั้งหลายที่มีความตั้งใจอ่านถึงตรงนี้ ขอขอบคุณ Reference ทุกท่านที่แบ่งปันข้อมูลต่างๆ ที่สามารถนำไปใช้ต่อได้นะคะ</p><p>พวกเราหวังว่าบทความนี้เป็นแนวทางในการทำ Machine Learning ให้ท่านผู้สนใจนำไปใช้ต่อได้นะคะ ♥</p><p><strong>References</strong></p><p><a href="https://datahack.analyticsvidhya.com/contest/practice-problem-loan-prediction-iii/">https://datahack.analyticsvidhya.com/contest/practice-problem-loan-prediction-iii/</a></p><p><a href="https://guopai.github.io/index.html">guopai.github.io</a></p><p><a href="https://www.glurgeek.com/education/support-vector-machine/">เรียนรู้และทำความเข้าใจเรื่อง Support Vector Machine (SVM) คืออะไร — GlurGeek.Com</a></p><p><a href="https://medium.com/@cheng3374/%E0%B8%A7%E0%B8%B1%E0%B8%94%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%AA%E0%B8%B4%E0%B8%97%E0%B8%98%E0%B8%B4%E0%B8%A0%E0%B8%B2%E0%B8%9E-model-%E0%B8%88%E0%B8%B2%E0%B8%81-confusion-matrix-69d391bcd48#:~:text=Confusion%20Matrix%20%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%95%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%87%E0%B8%AA%E0%B8%B3%E0%B8%84%E0%B8%B1%E0%B8%8D,%E0%B9%81%E0%B8%A5%E0%B8%B0%20%E0%B8%A1%E0%B8%B5%E0%B8%84%E0%B9%88%E0%B8%B2%20%E2%80%9C%20%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%88%E0%B8%A3%E0%B8%B4%E0%B8%87%20%E2%80%9D">วัดประสิทธิภาพ Model จาก Confusion Matrix | by chengz | Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d298b5eab8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book Recommendation ด้วย Neo4j]]></title>
            <link>https://pariyanuchprasertsirikul.medium.com/book-recommendation-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-neo4j-c6d055d19851?source=rss-5c168caa7ce3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6d055d19851</guid>
            <category><![CDATA[recommendations]]></category>
            <category><![CDATA[neo4j]]></category>
            <dc:creator><![CDATA[SUNG]]></dc:creator>
            <pubDate>Tue, 04 May 2021 15:04:38 GMT</pubDate>
            <atom:updated>2021-05-17T16:36:16.668Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ODN8cXzRUXKelX7q" /><figcaption>Photo by <a href="https://unsplash.com/@freestocks?utm_source=medium&amp;utm_medium=referral">freestocks</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>สวัสดีค่า เนื่องด้วยฉันกำลังเล่าเรียนวิชา <strong>Social Network Analysis </strong>หลักสูตรวิทยาศาสตรมหาบัณฑิต สาขาวิชาวิทยาการข้อมูล มศว และได้รับ Assignment ทำ Project เรื่องอะไรก็ได้ทีสนใจ ที่ Neo4j สามารถวิเคราะห์ได้ ก็เลยเลือกหัวข้อ การแนะนำหนังสือ มาเล่าให้ท่านอาจารย์ฟังนะคะ ท่านผู้อ่านสามารถดูเป็นแนวการเขียนคำสั่ง Cypher ลองเล่น Neo4j ดูนะคะ <em>ขอให้ทุกท่านมีความเพลิดเพลินกับการอ่านบทความนี้นะคt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*4-JPjuxiJkCdb4zUU464Yg.png" /></figure><p>หนังสือเป็นสิ่งที่มนุษย์ต้องการมากขึ้นในทุกวัน ทำให้มีการผลิตหนังสือจำนวนมากมาย ชื่อเรื่องต่างกันเข้ามาเรื่อยๆ ยังมีผู้แต่งหนังสือมากขึ้นเข้าไป บลาๆ จนกลายเป็น Big Data ทำให้ลูกค้าอาจจะไม่ทราบว่าเริ่มซื้อหนังสือตรงไหนดี เชื่อคำแนะนำจากเพื่อนๆดีมั้ย ซื้อเล่มไหนดีให้คุ้มค่าเงิน จะได้มีตังค์เก็บไว้ซื้อของกิน 555</p><p>ระบบแนะนำเป็นหนึ่งในเทคนิคที่สำคัญในการแนะนำสินค้าและบริการที่คาดว่า user น่าจะชอบ โดยเรียนรู้ข้อมูลความชอบของ user เช่น ระบบการแนะนำหนังหรือซีรีส์ของ Netflix ดูการแข่งขันทำอาหารของเชฟจบแล้ว จะเห็นว่า Netflix แนะนำสิ่งที่คล้ายกับสิ่งที่ดูเมื่อกี้ให้เลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*izQ4BmWzzxBN0nA9P_pBPA.png" /><figcaption><a href="https://www.netflix.com/">https://www.netflix.com/</a></figcaption></figure><p>อีก case หนึ่งของระบบแนะนำนะคะ ก็คือวิธีการทำขนม เวลาดูจบแล้ว Youtube จะแนะนำสิ่งที่คล้ายกับการทำขนมที่ดูจบแล้ว</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NK9zOkYH1a_G8fstqEbLgg.png" /><figcaption><a href="https://www.youtube.com/watch?v=3hA5yrzkgIQ">핑크핑크한🎀 동화속 비주얼♥ 딸기 생크림 케이크 만들기 : Strawberry cake Recipe : いちごのショートケーキ | Cooking ASMR — YouTube</a></figcaption></figure><p>ระบบแนะนำหนังสือก็ทำได้เช่นกันนะคะ</p><p>สำหรับระบบแนะนำนั้นมีสิ่งที่เรียนรู้พฤติกรรมของ user ที่ให้ rating หนังสือว่า เค้าถูกใจหนังสือมากน้อยแค่ไหน เรื่องอะไรบ้าง เรียนรู้จนกว่าเข้าใจ (บางครั้งอาจจะเรียนรู้เร็วกว่าคนก็ได้ 555) ก็คือ<strong> “<em>Collaborative Filtering”</em></strong> เป็นการแนะนำสินค้าหรือบริการ โดยพิจารณาความคล้ายกันของ user ที่เป็นเป้าหมายในการแนะนำกับผู้ที่ชอบคล้ายกัน</p><p>แล้วก็มีสิ่งที่ช่วยคำนวณคะแนนความคล้ายกันของลักษณะการให้ rating หนังสือ วิธีการวัดความคล้ายที่นิยมก็คือ “<strong><em>Cosine Similarity”</em></strong> ยังมีวิธีอื่นๆ เช่น Pearson Correlation Coefficient, Euclidean Distance บทความนี้เลือก Cosine Similarity ขอแนะนำให้รู้จักนะคะ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*bNJNn_5wti6r5e0EziRJ-w.png" /></figure><p>สมการ Cosine Similarity เป็นการหาค่าความคล้ายด้วยองศาระหว่าง user A และ user B โดยที่ Ai, Bi เป็น rating ของ user A และ user B ตามลำดับ เมื่อ i ={1,2,…,n=จำนวนเรื่องหนังสือทั้งหมดที่ user 2 คน ให้ rating หนังสือ}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*ZAxHP1JB_CAgrkXW" /><figcaption><a href="https://figshare.com/articles/figure/Identifying_site-_and_stimulation-specific_TMS-evoked_EEG_potentials_using_a_quantitative_cosine_similarity_metric_-_Fig_3/11592324/1">Identifying site- and stimulation-specific TMS-evoked EEG potentials using a quantitative cosine similarity metric — Fig 3 (figshare.com)</a></figcaption></figure><p>ค่าความคล้ายระหว่าง user A กับ user B (หากได้ค่าใกล้เคียง 1 แสดงว่า user A กับ user B มีความคล้ายกันมาก (High similarity) ส่วนค่าใกล้ๆ 0 แสดงว่า A ไม่ค่อยมีความคล้ายกับ B (Low similarity)</p><p>สิ่งที่ขาดไม่ได้ในการวิเคราะห์ความสัมพันธ์ของข้อมูลเชิงลึกเกี่ยวกับพฤติกรรมการให้ rating หนังสือของ user แต่ละคน ก็คือ “<strong><em>Neo4j”</em></strong> นะคะ เป็น Graph Database ที่สามารถวิเคราะห์ข้อมูลทางสถิติได้ เช่น ใครบ้างที่ชอบหนังสือคล้ายกับฉัน อยากได้หนังสือสัก 5 เล่ม ระบบแนะนำจะช่วยแนะนำหนังสือ 5 เล่มมาให้ฉัน ยังมีภาพหนังสือ ผู้แต่ง ทำให้ประหยัดเวลาเลือกซื้อหนังสือ</p><p>วิธีการติดตั้ง Neo4j นะคะ ติดตั้งแปบเดียวก็เสร็จแล้วค่ะ &gt;&gt; <a href="https://www.youtube.com/watch?v=hIvNexwVYNw">Getting Started with Neo4j Desktop on Windows (pre V 1.2.3) — YouTube</a></p><p>คำสั่ง “<strong><em>Cypher</em>”</strong> หลัก ๆ ใน Neo4j ที่ต้องรู้และเข้าใจความหมายของคำสั่งอย่างลึกซึ้ง ท่องไว้ก็ดีนะคะ</p><p>1. CREATE เพิ่ม node relationship property</p><p>2. MATCH เรียกข้อมูลจาก node relationship property</p><p>3. RETURN ส่งค่าผลลัพธ์กลับจากการเรียกข้อมูล</p><p>4. WHERE ตั้งเงื่อนไขในการเรียกข้อมูล</p><p>5. DELETE ลบ node relationship</p><p>6. REMOVE ลบ property ของ node relationship</p><p>7. ORDER By เรียงข้อมูลที่เรียกมา</p><p>8. SET เพิ่มหรือปรับปรุงป้ายชื่อ node</p><p>ภาพรวมการออกแบบระบบแนะนำหนังสือ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*Wh7iPqi0WxxgphfMF4PTEw.png" /></figure><p>ก่อนอื่นต้องทำความเข้าใจ<strong> Dataset </strong>เป็นข้อมูลการให้ rating หนังสือจาก <a href="https://www.kaggle.com/sahilkirpekar/goodreads10k-dataset-cleaned"><strong>Goodreads-10K Dataset | Kaggle</strong></a> มีหนังสือจำนวน 10,000 เล่ม ที่ผู้ใช้งานจำนวน 53,434 คน ให้คะแนนจำนวน 981,756 ครั้ง (1–5 คะแนน) บทความนี้ได้เลือกไฟล์ Books.csv เป็นข้อมูลรายละเอียดหนังสือ และไฟล์ Ratings.csv เป็นข้อมูลการให้คะแนนหนังสือโดยผู้ใช้งานเท่านั้น</p><p>ขั้นตอนต่อไปจะเป็นการเตรียมข้อมูลด้วย<strong> Python</strong> โดย concat 2 ไฟล์ดังกล่าว และสำรวจข้อมูลว่ามีค่า null หรือไม่ แล้วเลือก Feature ที่ใช้ ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*XdOqeLN7Kcp-JLFtqY0LQw.png" /><figcaption>เห็นแล้วใช่มั้ยคะว่าไม่มีค่า null สักตัว ถือว่าโชคดีแล้วกัน</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*nMkryRuT3rRLXaidm7c_tA.png" /><figcaption>หน้าตาข้อมูลแท้จริงนะคะ export ในรูปไฟล์ CSV ก่อนที่จะไปเที่ยว Neo4j</figcaption></figure><p>รายชื่อ Feature แต่ละ Column ดังนี้</p><p>1. userId = รหัสประจำตัวผู้ใช้งาน</p><p>2. rating = คะแนนที่ผู้ใช้งานให้กับหนังสือ (1–5 คะแนน)</p><p>3. bookId = รหัสประจำตัวหนังสือ</p><p>4. bookTitle = ชื่อเรื่องหนังสือ</p><p>5. author = ผู้แต่งหนังสือ</p><p>6. publicationYear = ปีที่ตีพิมพ์หนังสือ</p><p>7. imageUrl = Link ในรูปภาพ</p><p>8. isbn = เลขมาตรฐานสากลประจำหนังสือ</p><p>ผู้เขียนบทความจะเล่าให้ผู้อ่านเข้าใจ Graph Modeling ก่อนใช้งาน Neo4j จริงๆ นี่คือ <strong>Graph Modeling</strong> การให้ rating หนังสือ โดยตั้งชื่อเล่นให้ <strong>node </strong>2 ชนิด คือ<strong> User </strong>และ<strong> Book</strong> ส่วน <strong>relationship </strong>ถูกตั้งชื่อเล่นว่า <strong>RATED </strong>ต่าง node ต่างมี property ของตัวเอง relationship ก็มี property ของตัวเองเช่นกัน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*dc0sfDJd3BazQ1La2s2FMA.png" /><figcaption>แบบจำลองกราฟโดยใช้ <a href="http://www.apcjones.com/arrows/#">Arrow Tool (apcjones.com)</a></figcaption></figure><p>ท่านผู้อ่านคะ พอเข้าใจ Dataset, Graph Modeling, Cypher เบื้องต้นมั้ยคะ</p><p>พร้อมแล้วนะคะ ยินดีต้อนรับสู่การใช้ Neo4j กับการแนะนำหนังสือค่ะ</p><p>✿ เริ่มที่<strong> </strong>Import ไฟล์ CSV ที่ได้จาก Python เข้าสู่ Neo4j (ขอแนะนำว่าตั้งชื่อ column ในไฟล์ CSV ให้เหมือนชื่อ property ใน Neo4j ก็ได้ จะได้อ่าน Cypher คล่องๆ สบายตา 555 กลับเข้าเรื่องได้)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65dc4b068efcbe47133524989b3dd754/href">https://medium.com/media/65dc4b068efcbe47133524989b3dd754/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*xtKR5_8yU8fXmURy" /><figcaption>กราฟแสดงเครือข่ายการให้คะแนนหนังสือของผู้ใช้งาน (node สีชมพู = User, node สีเขียว = Book) จริงๆแล้วมีมากกว่านี้อีก บทความนี้เพียงใช้ข้อมูล 2,000 แถว เพื่อความเร็วการใช้งาน Neo4j</figcaption></figure><p>✿ แสดงแบบจำลองกราฟแสดงความสัมพันธ์แบบมีทิศทางจากโหนดผู้ใช้งานไปยังโหนดหนังสือ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea84923d5f0e56837e7cf5654d3834b3/href">https://medium.com/media/ea84923d5f0e56837e7cf5654d3834b3/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/0*pMltF9TEOeT2jdjG" /><figcaption>User ยิงไปที่ Book ด้วย RATED</figcaption></figure><p>✿ มีหนังสือเรื่องอะไรบ้างที่ user21713 และ user41074 อ่านเรื่องเดียวกัน</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/868bfb86efbc87575aa9d4ae43e978bf/href">https://medium.com/media/868bfb86efbc87575aa9d4ae43e978bf/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*GX2pl7fEQQemkyC9" /><figcaption>มีหนังสือ 4 เล่มที่ user21713 และ user41074 อ่านเรื่องเดียวกัน คือ Harry Potter and the Prisoner of Azkaban, The Hunger Games, Mockingjay, Catching Fire</figcaption></figure><p>✿ user 2 คนนี้ ให้ rating หนังสือแต่ละเล่มเท่าไรบ้าง</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/676a20bfdf069a505676c9e483d527a8/href">https://medium.com/media/676a20bfdf069a505676c9e483d527a8/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/0*qoZuK8bwzlmNdhOK" /><figcaption>user21713 ให้ rating หนังสือ 4, 5, 4, 4 ตามลำดับใน List ด้านบน ส่วน user41074 ให้ rating หนังสือ 3, 3, 3, 4 ตามลำดับ</figcaption></figure><p>✿ user 2 คนเดิม มีความชอบหนังสือคล้ายกันหรือไม่ ก็เลยต้องหาคะแนนความคล้ายด้วยวิธี Cosine similarity</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/858d33d71f1c9c03db441c923724cbdd/href">https://medium.com/media/858d33d71f1c9c03db441c923724cbdd/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*UfMlc7q1C_YSn86F" /><figcaption>ท่านผู้อ่านได้คำตอบตรงนี้แล้วว่า user21713 กับ user41074 มีความชอบหนังสือคล้ายกันด้วยคะแนน 0.98 หมายความว่าคล้ายกันมากเลยทีเดียว</figcaption></figure><p>✿ นอกจาก user41074 ที่ชอบหนังสือคล้ายกับ user21713 มีใครชอบหนังสือคล้ายกับเค้าบ้าง</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5cf3a860278c2044feefbfd29201778/href">https://medium.com/media/e5cf3a860278c2044feefbfd29201778/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*UHmhthEOSMA34vjZ" /><figcaption>พบว่ามีผู้ใช้งานที่ชอบหนังสือคล้ายกับ user21713 มากที่สุดด้วยคะแนนเท่ากับ 1 จำนวน 138 คน รองลงมาคะแนนความคล้ายเท่ากับ 0.99 (54 คน), 0.98 (20 คน), 0.97 (9 คน), 0.96 (5 คน)</figcaption></figure><p>✿ สร้าง relationship คะแนนความคล้ายกันระหว่างผู้ใช้งานที่ได้จากการคำนวณ Cosine similarity</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/edc3eba3404342c88c1ff81b503550cf/href">https://medium.com/media/edc3eba3404342c88c1ff81b503550cf/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*sXAKldjfnp3FsLVA" /></figure><p>✿ สร้างอีก relationship การแนะนำ เมื่อคะแนนความชอบคล้ายกันมากกว่า 0.5</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38f4734d1b108a739caada49c7e84629/href">https://medium.com/media/38f4734d1b108a739caada49c7e84629/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/0*WBJbhFm6U0RKGi-6" /></figure><p>✿ ลบ relationship การแนะนำหนังสือเรื่องเดียวกับหนังสือที่ผู้ใช้งานให้คะแนนแล้ว ก็เลยไม่ได้แนะนำหนังสือเล่มนั้นให้กับผู้ใช้งาน</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/057488ce6edaeef0af6d4e7059f9bb52/href">https://medium.com/media/057488ce6edaeef0af6d4e7059f9bb52/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/0*T07ZTOjA-NKFXZo7" /></figure><p>✿ จากที่ได้ List users ที่ชอบหนังสือคล้ายกับ user21713 ด้วยคะแนนความคล้ายมากกว่า 0.5 สุ่มเลือก user1185 ต่อไปจะแนะหนังสือเรื่องอะไรดีให้กับ user1185 (user1185 กับ user21713 ชอบคล้ายกันมากกว่า 0.5)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/588a6b3f9c70cb05008fcfb61af31f24/href">https://medium.com/media/588a6b3f9c70cb05008fcfb61af31f24/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*VZf2JfxHT-s8nzQZ" /><figcaption>มีหนังสือ 3 เรื่องที่ผู้ใช้งาน 2 คนให้ rating เรื่องเดียวกัน ได้แก่ Catching Fire, The Hunger Games, Mockingjay ก็เลยแนะนำหนังสือเรื่อง Divergent กับ Harry Potter and the Prisoner of Azkaban ให้กับ user1185</figcaption></figure><p>✿ อยากแนะนำหนังสือให้กับ user1185 อีก นอกจากแนะนำหนังสือ 2 เรื่องด้านบนไปแล้วนั้น สัก 10 เรื่องก็พอเนอะ</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6dcbc5811bec63ff64b5f01635d78e8/href">https://medium.com/media/e6dcbc5811bec63ff64b5f01635d78e8/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*opu9BNa63GyswxOfKhFalQ.png" /></figure><p>สามารถ click link ชมภาพหนังสือที่ Neo4j ด้วย Perfect! เช่น imageUrl เรื่อง Harry Potter and Prisoner of Azkaban ได้รูปด้านล่างนะคะ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/124/0*Sh-5vOHOINvLkEq4" /></figure><p>✿ ในที่สุดได้ Complete Graph แสดงเครือข่ายการแนะนำหนังสือให้กับผู้ใช้งานทุกคน</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b47e12125679239cfeee58addd514ae9/href">https://medium.com/media/b47e12125679239cfeee58addd514ae9/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*57MX7yDx7g-FNt-0" /></figure><p>บทความนี้เป็นการวิเคราะห์ข้อมูลการแนะนำหนังสือเบื้องต้นทางสถิติด้วย Neo4j นำเสนอเพียงเทคนิคการวัดความคล้ายระหว่างผู้ใช้งานด้วยวิธี Cosine Similarity เทคนิคนี้ยังคงมีข้อจำกัดคือ หากผู้ใช้งานไม่ได้ให้ rating หนังสือ เมื่อนำข้อมูลนี้ไปสร้างรายการแนะนำหนังสือให้กับผู้ใช้งาน อาจจะส่งผลให้รายการแนะนำที่ได้ไม่ตรงตามความชอบของผู้ใช้งานก็ได้นะคะ</p><blockquote>หากท่านผู้อ่านอยากลองเล่น Neo4j ทุก step ที่เล่าให้ฟัง เชิญชมขั้นตอนการใช้งานนะคะ</blockquote><blockquote><a href="https://github.com/sunglovedatascience/sna_bookrecommendation">https://github.com/sunglovedatascience/sna_bookrecommendation</a></blockquote><blockquote>หวังว่าบทความนี้คงเป็นแนวทางการเขียนคำสั่ง Cypher ในการวิเคราะห์การแนะนำหนังสือต่อไปนะคะ</blockquote><p>✿ขอบคุณอาจารย์ทุกท่าน รายวิชา Social Network Analysis หลักสูตรวิทยาศาสตรมหาบัณฑิต สาขาวิชาวิทยาการข้อมูล มศว ที่คอยสอน ให้คำแนะนำตลอดเวลา ทำให้ฉันมีมุมมองที่กว้างขึ้นนะคะ</p><p>✿ขอบคุณเพื่อนๆ ที่คอยช่วยเหลือเสมอ คอยบอกการบ้านนะคะ</p><p>✿ขอบคุณผู้วิจัย ผู้แต่งหนังสือ ทุกท่าน ที่เผยแพร่ข้อมูลที่สามารถนำไปใช้ประโยชน์ในการทำ Project นะคะ</p><p>✿ขอบคุณผู้อ่านทั้งหลายที่มีความตั้งใจอ่านมาถึงตรงนี้นะคะ</p><p>✿ขอบคุณความกล้าของฉันที่ทำให้ได้ลองทำอะไรใหม่ๆ ด้วยตัวเองนะคะ</p><p><strong>References</strong></p><p>D. Naga Jyothi, “Book Recommendation Systemusing Neo4j Graph Database,” <em>The International journal of analytical and experimental modal analysis, </em>vol. 12, no. 6, pp. 498–504, 2020.</p><p>Phonexay Vilakone, Doo-Soon Park, Khamphaphone Xinchang and Fei Hao, “An Efficient movie recommendation algorithm based on improved k-clique,” <em>Vilakone et al. Hum. Cent. Comput. Inf. Sci., </em>vol. 8, no. 38, pp. 1–15, 2018.</p><p>Víctor Martínez, Fernando Berzal and Juan-Carlos Cubero, “A Survey of Link Prediction in Complex Networks,” <em>ACM Computing Surveys, </em>vol. 49, no. 4, pp. 69:1–69:33, 2016.</p><p>Li, Y.M., Hsiao, H.W. and Lee, Y.L., “Recommeding social network application via social filtering mechanisms,” <em>Inf. Sci., </em>Vols. 18–30, p. 239, 2013.</p><p>Sridhar Dilip Sondur, mit P Chigadani and Shantharam Nayak, “Similarity Measures for Recommender Systems: A Comparative Study,” <em>Journal for Research, </em>vol. 2, no. 3, pp. 76–80, 2016.</p><p>SahilkK, “https://www.kaggle.com/sahilkirpekar/goodreads10k-dataset-cleaned,” 2020. [Online].</p><p>วรนุช ศรีพลัง และวงกต ศรีอุไร, “การพัฒนาระบบแนะนำข้อมูลสำหรับห้องสมุดออนไลน์โดยใช้วิธีการกรองข้อมูลแบบพึ่งพาผู้ใช้ร่วมและข้อมูลส่วนบุคคล,” <em>วารสารมหาวิทยาลัยศรีนครินทรวิโรฒ (สาขาวิทยาศาสตร์และเทคโนโลยี), </em>ปีที่ 9, ฉบับที่ 118, หน้า 150–164, 2560.</p><p>นลินี โสพัศสถิตย์, “การใช้ระบบแนะนำสนับสนุนการตัดสินใจ,” มหาวิทยาลัยราชภัฏสวนสุนันทา, กรุงเทพมหานคร, 2555.</p><p>วฤษาย์ ร่มสายหยุด, นีโอโฟว์เจ : ฐานข้อมูลกราฟสำหรับการวิเคราะห์, กรุงเทพฯ: ซีเอ็ดยูเคชั่น, 2563.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6d055d19851" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NoSQL ชอบใส่หมวก CAP]]></title>
            <link>https://pariyanuchprasertsirikul.medium.com/nosql-%E0%B8%8A%E0%B8%AD%E0%B8%9A%E0%B9%83%E0%B8%AA%E0%B9%88%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%81-cap-ae2de95b77e7?source=rss-5c168caa7ce3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae2de95b77e7</guid>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[SUNG]]></dc:creator>
            <pubDate>Fri, 11 Dec 2020 12:38:27 GMT</pubDate>
            <atom:updated>2020-12-11T12:38:27.309Z</atom:updated>
            <content:encoded><![CDATA[<p>นางไม่ได้เป็น Relationship Database (RDB) พรสวรรค์ของนางคือ เก็บ Unstructured Data และขยายระบบในแนวนอนเพื่อรับข้อมูลมากขึ้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*r5U_SZzFCZGrD-PIMKq4AQ@2x.jpeg" /></figure><blockquote>นางอยากได้ความเร็วการใช้งาน ไม่อยากได้ความแม่นยำ</blockquote><ul><li>เกิดจากเหตุการณ์ที่ Johan Oskarsson ได้เสนอแนวคิดการจัดเก็บข้อมูลในที่ Meet-Up และได้ #NoSQL ใน Twitter เมื่อปี 2000 ทำให้เกิดคำว่า NoSQL</li><li>เกิดจากปัจจัยต่างๆ ก็จากข้อมูลปริมาณมาก ปัญหาคุณสมบัติ ACID (คืออะไร <a href="https://phuri.medium.com/nosql-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-%E0%B8%95%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B8%88%E0%B8%B2%E0%B8%81-rdbms-%E0%B8%AB%E0%B8%A3%E0%B8%B7%E0%B8%AD-sql-database-%E0%B8%AD%E0%B8%A2%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B9%84%E0%B8%A3-dd8ac91a4197">click อ่านบทความ</a>) ของ RDB ที่เน้นความถูกต้อง แล้วก็ประเภทข้อมูลหลากหลาย มีเทคโนโลยีด้าน Hardware ที่ถูกลงแต่มีประสิทธิภาพมากขึ้น</li><li>Google BigTable ถูกเผยแพร่ในปี 2006 อธิบาย DB ที่มีโครงสร้างแบบกระจายที่รองรับข้อมูล BigData ระดับ Petabyte ที่ทำงานอยู่บน Server ธรรมดาพันเครื่อง</li><li>DynamoDB ถูกเผยแพร่ในปี 2007 ที่บรรยายถึง App ที่จัดเก็บข้อมูลชื่อ Dynamo เป็นบทความแรกที่จัดเก็บแบบ Key-Value ในรูปแบบกระจาย</li></ul><h3>มีอะไรในหมวก CAP (Theorem) ของ NoSQL</h3><ul><li><strong>Consistency</strong> ทุก Node เห็นข้อมูลเดียวกันในเวลาเดียวกัน ไม่ว่าเข้าถึง Node ใดหนึ่งใน Cluster ก็ตาม</li><li><strong>Availability </strong>หาก Node ใดไม่สามารถทำงาน ระบบยังให้บริการต่อได้</li><li><strong>Partition Tolerance</strong> หากเส้นทางเชื่อม Node มีปัญหา ระบบก็ยังให้บริการได้อยู่ เพราะว่าระบบทำงานแบบกระจาย</li></ul><p>หยิบ 2 อันที่ชอบมาให้เข้ากับ DB ได้แก่ CA (เป็นของ RDB) ก็เหลือ CP AP ที่ NoSQL ต้องมี Partition Tolerance มาคู่</p><ul><li>AP ดึงข้อมูลจาก DB ได้ตลอด แม้ว่า DB เสียหายบางส่วนก็ตาม</li><li>CP ต้องรอให้ข้อมูล Update ก่อนถึงอ่านข้อมูลได้</li></ul><p>Brands ของ CA มี MySQL Postgres ส่วน CP มี Redis MongoDB HBase สุดท้าย AP เช่น Voldemort (ไม่ใช่ศัตรูของ HarryPotter นะ 555) Cassandra CatchDB</p><h3><strong>สิ่งที่พกติดตัวของ NoSQL มี 4 อย่าง</strong></h3><ul><li><strong>Schema-less</strong> มันมีความยืดหยุ่นในการจัดการ DB ไม่แคร์ว่าเก็บข้อมูลอะไร สัมพันธ์ยังไง เมื่อนำมาใช้ก็ไม่ต้องทำ Join</li><li><strong>Non relational DB </strong>ข้อมูลมีความซ้ำซ้อน มีประโยชน์ตรงที่สืบค้นง่ายแหละ ไม่เสียเวลา Join ด้วย</li><li><strong>Distributed System</strong> นางออกแบบเพื่อใช้งานคอมหลายตัวช่วยจัดเก็บข้อมูลแทน Server โดดเดี่ยว เพื่อเพิ่มขนาด Storage เพิ่มประสิทธิภาพ รองรับขยายมากขึ้น</li><li><strong>Integrated Caching</strong> นางเก็บข้อมูลที่ถูกเข้าบ่อยๆไว้ในหน่วยจำของระบบ ทำให้ทำงานกับข้อมูลอย่างรวดเร็ว</li></ul><h3>NoSQL มี Style การแต่งตัวมี 4 แบบ</h3><ul><li><strong>Key-Value DB</strong> เก็บข้อมูลหลาย Field เป็นชุดๆ แต่ละ Record อาจมีจำนวน Field ไม่เท่ากันก็ได้ ทำให้ใช้หน่วยความจำน้อยกว่า Brands ของนางมีให้เลือก Riak Redis HamstarDB</li><li><strong>Document DB</strong> จัดเก็บ สืบค้นข้อมูลในรูปแบบเอกสาร JSON XML BSON เข้าใจนางได้เลยว่าข้อมูลจะบอกอะไร Brands จะมี MongoDB CouchDB LotusNotes</li><li><strong>Column DB</strong> ก็เก็บข้อมูลในรูปแบบตารางตาม Column ตรงชื่อนั่นแหละ มักใช้กับการวิเคราะห์เชิงธุรกิจ เช่น หาค่าเฉลี่ยเงินเดือน ไม่ต้องอ่าน Record ของทุกคน Brands เช่น Cassandra HBase Hypertable</li><li><strong>Graph DB</strong> เก็บ Entity กับความสัมพันธ์ระหว่าง Entity (เรียกว่า Edge) จะท่องไปในกราฟได้เร็ว เพราะ Edge ยังคงอยู่</li></ul><blockquote>สาม Style ที่แต่งตัวคล้ายกัน Key-Value Document Column DB ก็คือ ข้อมูลที่สัมพันธ์กันเก็บไว้ต้วยกัน จัดเก็บข้อมูลง่ายดี เรียกว่า<strong> Aggregate Orientation</strong></blockquote><h3>ความชอบของนางก็รองมาเป็น BASE</h3><ul><li><strong>Basically Available </strong>DB มีความพร้อมใช้งานตลอดเวลา</li><li><strong>Soft State</strong> เขียนข้อมูลแล้วจะไม่ Save ไปยังทุกเครื่องพร้อมกัน</li><li><strong>Eventual Consistency</strong> เมื่อมีสำเนาข้อมูลแต่ละ Node จะมีข้อมูลเหมือนกัน แต่อาจไม่ใช่ version ล่าสุด ซึ่งจะถูกเก็บใน Node ใดหนึ่งใน Cluster แล้วจะสำเนาล่าสุดออกไป สุดท้ายทุก Node จะเป็นข้อมูลชุดเดียวกัน</li></ul><p>ขอบคุณ ผศ.ดร.วราภรณ์ วิยานนท์ และหนังสือดีๆ ที่อ.เขียน ใครสนใจเข้าไปซื้อหนังสือได้ที่ <a href="https://stoubook.stou.ac.th/product/3928/99711_%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%A7%E0%B8%B4%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B2%E0%B8%B0%E0%B8%AB%E0%B9%8C%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5%E0%B8%82%E0%B8%99%E0%B8%B2%E0%B8%94%E0%B9%83%E0%B8%AB%E0%B8%8D%E0%B9%88%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%98%E0%B8%B8%E0%B8%A3%E0%B8%81%E0%B8%B4%E0%B8%88/">99711 การวิเคราะห์ข้อมูลขนาดใหญ่สำหรับธุรกิจ — STOU Book</a> นะคะ ❤️️</p><p>ขอบคุณภาพซิบบิลจาก <a href="https://pin.it/4teu3x0">https://pin.it/4teu3x0</a> ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae2de95b77e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon SageMaker Studio ตัวเดียวครบเครื่องการทำ Machine Learning]]></title>
            <link>https://pariyanuchprasertsirikul.medium.com/amazon-sagemaker-studio-%E0%B8%95%E0%B8%B1%E0%B8%A7%E0%B9%80%E0%B8%94%E0%B8%B5%E0%B8%A2%E0%B8%A7%E0%B8%84%E0%B8%A3%E0%B8%9A%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%97%E0%B8%B3-machine-learning-a5e1a9c9fcfb?source=rss-5c168caa7ce3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5e1a9c9fcfb</guid>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[SUNG]]></dc:creator>
            <pubDate>Fri, 11 Dec 2020 05:58:18 GMT</pubDate>
            <atom:updated>2020-12-25T15:07:55.849Z</atom:updated>
            <content:encoded><![CDATA[<p>สวัสดีค่าาาา ทุกท่าน ขอบคุณที่ click ชมบทความนะคะ บทความนี้จะเล่าถึง How to build, train, deploy, monitor Machine Learning with Amazon SageMaker Studio ค่ะ</p><blockquote>Get everything done by doing ONE Thing</blockquote><p>❤️️<strong>Why Do We Need Amazon SageMaker Studio?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sW1iyj6RdbPV3u5G2Q78w.png" /></figure><h4>❤️️<strong>Background</strong></h4><ul><li>ข้อมูลที่ใช้ในการฝึกฝนโมเดลมีปริมาณมหาศาล ทำให้ต้องใช้พื้นที่จัดเก็บข้อมูลมาก</li><li>ต้องใช้คอมพิวเตอร์ที่มีประสิทธิภาพสูงในการทำ ML ทำให้มีค่าใช้จ่ายในส่วนของพื้นที่ ค่าบำรุงรักษาระบบ</li><li>ต้องการ Algorithm ที่เหมาะสมที่สุดในการฝึกฝนโมเดล เพื่อให้ได้ผลการทำนายที่มีคุณภาพ</li><li>ต้องรวบรวมเครื่องมือ และ Workflow ต่างๆ เข้าด้วยกัน ทำให้ใช้เวลานาน เกิดข้อผิดพลาดได้ง่าย</li></ul><h4>❤️️<strong>Objects</strong></h4><ul><li>เพื่อศึกษาและเข้าใจวิธีการสร้าง ฝึกฝน ปรับใช้ ตรวจสอบ ML โดยใช้ Amazon SageMaker Studio ให้ดำเนินงานอย่างมีประสิทธิภาพ</li><li>เพื่อออกแบบการทำงานของ SageMaker Studio ในการสร้าง ฝึกฝน ปรับใช้ ตรวจสอบ ML ให้เป็นไปตาม Well Architected Framework</li><li>เพื่อให้สามารถให้ได้ข้อมูลเชิงลึกที่มีประสิทธิภาพ โดยใช้ SageMaker Studio</li><li>เพื่อให้มีความสะดวกในการสร้าง ฝึกฝน ปรับใช้ ตรวจสอบ ML ด้วยเครื่องมือเดียว SageMaker Studio</li><li>เพื่อลดค่าใช้จ่ายในการใช้คอมพิวเตอร์ในการจัดเก็บข้อมูล ค่าบำรุงรักษาระบบ</li><li>เพื่อลดขั้นตอนในการสร้าง ฝึกฝน ปรับใช้ ตรวจสอบ ML</li></ul><h4>❤️️What is Amazon SageMaker Studio?</h4><ul><li>เครื่องมือทำ Machine Learning ครบเครื่องในตัวเดียว (IDE)</li><li>ให้บริการที่จัดการเต็มรูปแบบที่ช่วยให้ Developer Scientist สร้าง Train ติดตั้งใช้ ML Model ได้เร็ว</li><li>ช่วยลด Step การทำ ML ทำให้การพัฒนา ML มีคุณภาพสูงขึ้น</li></ul><h4>❤️️ความสามารถของ Amazon SageMaker Studio</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u7cG_2omBpymd9oK" /></figure><h4>❤️️Feature ต่างๆ ของ Amazon SageMaker Studio</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d2CqmamXIVv0iUnD" /></figure><h4>❤️️<strong>การจัดการความท้าทายกับ Maching Learning ด้วย Amazon SageMaker Studio</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*Zpjc_cx0n-F5zny-" /></figure><h4>❤️️Amazon SageMaker Studio User interface</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HV0QhbkMElRIoMCc" /></figure><h4>❤️️How does <strong>Amazon </strong>SageMaker Studio pricing work?</h4><ul><li>ใช้ SageMaker Studio ได้ฟรี</li><li>จ่ายเฉพาะบริการของ AWS ที่ใช้ภายใน Studio เท่านั้น</li></ul><h4>❤️️How to build, train, deploy, monitor ML with Amazon SageMaker Studio?</h4><ol><li>ตั้งค่า Amazon SageMaker Studio Control Panel</li><li>Download public dataset โดยใช้ Amazon SageMaker Studio Notebook และ upload ไปยัง Amazon S3</li><li>สร้าง Amazon SageMaker Experiment เพื่อติดตามและจัดการงานฝึกอบรมและการประมวลผล</li><li>เรียกใช้งาน Amazon SageMaker Processing เพื่อสร้าง features จากข้อมูลดิบ</li><li>Train model โดยใช้ XGBoost algorithm</li><li>ทดสอบประสิทธิภาพ model ของ test dataset โดยใช้ Amazon SageMaker Batch Transform</li><li>ปรับใช้ model เป็น endpoint และตั้งค่างานการตรวจสอบเพื่อตรวจสอบ model endpointในการผลิตสําหรับ data drift</li><li>แสดงผลลัพธ์ และตรวจสอบ model โดยใช้ SageMaker Model Monitor เพื่อหาความแตกต่างระหว่าง training dataset และ model ที่ปรับใช้</li></ol><h4>Step 1 Create an AWS Free Tier Account</h4><p>ถ้าคุณยังไม่มีบัญชี AWS สมัครได้ที่ <a href="https://aws.amazon.com/th/free/?trk=ps_a134p000003yHzNAAU&amp;trkCampaign=acq_paid_search_brand&amp;sc_channel=PS&amp;sc_campaign=acquisition_TH&amp;sc_publisher=Google&amp;sc_category=Core&amp;sc_country=TH&amp;sc_geo=APAC&amp;sc_outcome=acq&amp;sc_detail=%2Baws%20%2Bfree&amp;sc_content=Cost_bmm&amp;sc_segment=444351556317&amp;sc_medium=ACQ-P%7CPS-GO%7CBrand%7CDesktop%7CSU%7CAWS%7CCore%7CTH%7CEN%7CText&amp;s_kwcid=AL!4422!3!444351556317!b!!g!!%2Baws%20%2Bfree&amp;ef_id=CjwKCAiAq8f-BRBtEiwAGr3DgQFf-0ITSR5cmsT94K78ElD48V-s98BtrCWvlLNLZuPgGA5oPYbwhBoCUoEQAvD_BwE:G:s&amp;s_kwcid=AL!4422!3!444351556317!b!!g!!%2Baws%20%2Bfree&amp;all-free-tier.sort-by=item.additionalFields.SortRank&amp;all-free-tier.sort-order=asc">AWS Free Tier (amazon.com)</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*y7dQmVR4ROl7bP-H" /></figure><p><strong>Step 2 Create your Amazon SageMaker Studio Control Panel</strong></p><ul><li>คลิก Services -&gt; พิมพ์ “sagemaker” ในช่อง -&gt; Amazon SageMaker</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/0*663JhxHrp-0jTPXd" /></figure><ul><li>เลือก N. Virginia Region -&gt; Amazon SageMaker Studio</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*5x-MAwwNOwtW9YCd" /></figure><ul><li>เลือก Quick start -&gt; ตั้งชื่อ User name -&gt; Create a new role</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*NGE9Ob_XQbEohLL2" /></figure><ul><li>คลิก Any S3 bucket -&gt; Create role</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/0*Kx9sF8O8ZmCEHsck" /></figure><ul><li>พบว่าได้สร้าง IAM role เสร็จสิ้น -&gt; คลิก Submit</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/0*b3Senegw9Nj3Cp1w" /></figure><p><strong>Step 3 Download the dataset</strong></p><ul><li>คลิก Username ที่ตั้งชื่อไว้ -&gt; Open Studio</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*TpehLvVStZRpZFpV" /></figure><ul><li>ใน Jupyter Lab เลือก Python 3 (Data Science)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/0*qMLBDwVOFL2khdzP" /></figure><blockquote>ต้องรอ Code ทำงานเสร็จจนกว่า [*] จะกลายเป็น [number] ทุกๆ Block (บาง block ต้องรอนิดนึง)</blockquote><ul><li>ขั้นแรกให้ตรวจสอบ version ของ Amazon SageMaker Python SDK</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/0*AhyZ-vgV6JpL5eVY" /></figure><ul><li>Import Library ต่างๆ ที่ต้องใช้งาน</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/0*SiGZs0_A8teCCbB0" /></figure><ul><li>Import Experiments ต่างๆ</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/0*61KZtvWQ96QUxTUK" /></figure><ul><li>สร้าง Bucket และ Amazon S3 Folder สำหรับ Project</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*Bxx3qA6iCCfMxXoW" /></figure><ul><li>Download และ import dataset โดยใช้ Pandas library</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/0*AV2YKzy7DSqpktFF" /></figure><ul><li>เปลี่ยนชื่อ column สุดท้าย เป็น label และแยก label column ต่างหาก สำหรับ XGBoost algorithm จะใช้ label column เป็น column แรกของ dataframe</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*Wl8ojda3vOKhkHq-" /></figure><ul><li>Upload CSV dataset เข้า Amazon S3 bucket</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Grf0-GNbTwZ7l3aa" /></figure><p><strong>Step 4 Process the data using Amazon SageMaker Processing</strong></p><ul><li>Import scikit-learn processing container และ preprocessing ไปยัง Amazon S3</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*aEAjG6OH2c8yMoW0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*9H0-sNDqj1NJcF_A" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/0*JEab4Jsp0QCsY2o2" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*tDq6BD4JBlCeNzFf" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/0*z88QgepPh8InY9Bg" /></figure><ul><li>ระบุตำแหน่งที่ต้องการจัดเก็บ train data และ test data หลังจาก preprocessing SageMaker เสร็จสิ้น</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*VDcNFy_QSdzgZyIW" /></figure><ul><li>บันทึกตำแหน่งที่จัดเก็บให้กับ Processor</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/0*xOXVcKgMKrhVYqsi" /></figure><p><strong>Step 5 Create an Amazon SageMaker Experiment</strong></p><ul><li>ขณะนี้ได้ download และจัด dataset ใน Amazon S3 แล้ว สามารถสร้าง Amazon SageMaker Experiments ได้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*X76LZzSt1HBRPAJ1" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*qHTU2NahuI90hT1R" /></figure><ul><li>ดูรายละเอียดของ Experiments โดยคลิกขวาที่ Build-train-deploy ใน Experiments -&gt; Open in trial component list</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*6Ocjgylgh7d7oWDy" /></figure><ul><li>ในการ train XGBoost classifier จะต้อง import XGBoost container ที่ดูแลโดย Amazon SageMaker ก่อน จากนั้นบันทึกการทำงาน training ภายใต้ experiments เพื่อให้ SageMaker Experiments สามารถติดตามได้ งาน processing ล่วงหน้าจะรวมอยู่ใน experiments เดียวกัน เนื่องจากเป็นส่วนหนึ่งของ pipeline จากนั้นให้สร้างวัตถุ SageMaker Estimator ซึ่งจัดเตรียมประเภท instance พื้นฐานที่เลือกโดยอัตโนมัติ คัดลอก training data จากตําแหน่งที่ระบุจากงาน preprocessing, train model, output ออกมา</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*ZyhdSOqzsWZt8Mal" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*2DNSXHRMGKriGq6C" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/0*zReU2cPYtvqmwTGb" /></figure><ul><li>ในแถบด้านซ้ายเลือก Experiments คลิกขวาที่ Build-train-deploy แล้วเลือก Open in trial components list ปกติAmazon SageMaker Experiments จะจับภาพการวิ่งทั้งหมดรวมถึงการ train ที่ failed ตัวสีแดงใน status แต่สำหรับงานนี้ไม่มี failed ในการ train</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*16zbQF0-J-nblG2s" /></figure><ul><li>คลิกขวาที่ Build-train-deploy ในงานการ train ที่เสร็จสมบูรณ์ และเลือก Open in Trial Details (อาจจะต้องคลิก refresh)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fCy1rySehF08o9bj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*RI5jajWTzTgfCzqI" /></figure><p><strong>Step 6 Deploy the model for offline inference</strong></p><ul><li>Copy test dataset จากตำแหน่ง Amazon S3 ไปยัง folder ภายในเครื่องคอม</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*6jTMTlt20_Js_bY9" /></figure><ul><li>อ่านไฟล์ csv โดยใช้ pandas</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/0*GCWnZrIl01s03AMd" /></figure><ul><li>แยก label column</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*uHgyPWdk8x2wDlrb" /></figure><ul><li>สร้างงาน Batch Transform เช่นเดียวกับงานการ train SageMaker จะจัดเตรียมทรัพยากรพื้นฐานทั้งหมด, copy model ที่ผ่านการ train, ตั้งค่า Batch endpoint ภายในเครื่อง, copy ข้อมูลและเรียกใช้การอนุมานของข้อมูลและส่ง outputs ไปยัง Amazon S3</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*Vdik5YIWgS-P8zdQ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/0*5wIqT-rWkn2bf1Zo" /></figure><ul><li>ผลลัพธ์ที่ได้จากการประเมิน model metrics คือจำนวนรวมของ Predicted True และ Predicted False เมื่อเทียบกับ Actual True และ Actual False</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/0*YPHidQZwNZppgB_6" /></figure><ul><li>แสดงค่าความแม่นยำของ simple model และความแม่นยำของ baseline จะเห็นว่า simple model มีความแม่นยำกว่า baseline ดังนั้น สามารถปรับ Hyperparameter</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/0*tTdIiOID9qrIjj32" /></figure><p><strong>Step 7 Deploy the model as an endpoint and set up data capture</strong></p><ul><li>เรียกใช้งานตาม code</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/0*q1214BmQJEZ8l7kd" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*BdGT0KVv9TttIoIr" /></figure><ul><li>เมื่อต้องการระบุการตั้งค่าการกําหนดค่าข้อมูล ตาม code จะให้ SageMaker จับ 100% ของ payloads อนุมานที่ได้รับจาก endpoint, capture ทั้ง input output และยังบันทึกชนิดเนื้อหาของ input เป็น csv</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*vplpQnm_iZ2VgtVV" /></figure><ul><li>สร้างการตั้งค่า endpoint ปรับใช้ endpoint สามารถระบุชนิด instance และระบุว่าต้องการรับส่งข้อมูลทั้งหมดไปยัง endpoint นี้หรือไม่</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/0*LoQEw3JJTQvXuUtF" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*4fjKk0dAghg-t4vH" /></figure><ul><li>สร้าง endpoint</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*AjuM7SyDe1aRTrg-" /></figure><ul><li>ในแถบเครื่องมือด้านซ้ายคลิก endpoint รายการ endpoint จะแสดง endpoint ทั้งหมดในการให้บริการ เมื่อสร้าง endpoint แล้ว สถานะจะเปลี่ยนจาก Creating เป็น InService</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/0*s-Xs6q0OnIaOfV4R" /></figure><ul><li>เก็บตัวอย่าง test dataset โดยใช้ 10 แถวแรก</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*aviiBp51-9ZZ5N9k" /></figure><ul><li>ส่งคําขออนุมานบางอย่างไปยัง endpoint นี้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*0djMmPc7A7GMkOpq" /></figure><ul><li>Model Monitor จะ Capture ว่าข้อมูลขาเข้าถูกต้องหรือไม่</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/0*XJTSYYl_Qc7hpLDz" /></figure><ul><li>แยกเนื้อหาของหนึ่งในไฟล์ Json และดู Output ที่จับได้ จะเห็นว่า Output แสดงถึงCapture ข้อมูลทั้ง payloads ของ Input และ Output ของ Model</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/0*UbC5KKKmgvmS3VQ_" /></figure><p><strong>Step 8: Monitor the endpoint with SageMaker Model Monitor</strong></p><ul><li>สร้าง Folder ใน S3 Bucket เพื่อจัดเก็บ Output ของจอภาพ</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/0*Mjr_4IdrOgRMTN1v" /></figure><ul><li>ตั้งค่างาน Baseline สําหรับ Model Monitor เพื่อเก็บสถิติของข้อมูลการ train</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*BTmrk_i6U4J2knZY" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/0*D5brvCLzEE_1IjsE" /></figure><ul><li>ดู Output ที่ได้จากงาน baseline จะเห็นว่ามี 2 ไฟล์ constraints.json และ statistics.json</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/0*kL94q4pEl_3IFsNi" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*YzdIqIwRNZ89bina" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mkh1dwmdNNOnB1T1" /></figure><ul><li>ในทํานองเดียวกันไฟล์ constraints.json ประกอบด้วยจำนวนข้อจํากัดที่ training dataset ทำตาม เช่น การไม่ปฏิเสธค่า และชนิดข้อมูลของ feature field</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*kkjvBJ6LYRcpzMFB" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*t6W2fTuSqyHGDi-R" /></figure><ul><li>ตั้งค่าความถี่สําหรับการตรวจสอบ endpoint โดยสามารถระบุความถี่ต่อวันหรือชั่วโมงได้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/0*hR24yINeSlPVuFu9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*JyYZbMYFwxsjSVjK" /></figure><p><strong>Step 9: Test SageMaker Model Monitor performance</strong></p><ul><li>Import test data และสร้าง sample data ที่แก้ไขแล้ว</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bSRHi-oH5RjBRLGv" /></figure><ul><li>เปลี่ยน column 2–3 columns สังเกตความแตกต่าง column ของ EDUCATION, BILL_AMI2, AGE จากขั้นตอนก่อนหน้านี้ ปล่อย label column และบันทึก sample test data ที่แก้ไขแล้ว</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/0*ZYfE7nvgiVe83WCK" /></figure><ul><li>เรียกใช้ endpoint ซ้ำๆ ด้วย dataset ที่แก้ไขนี้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/0*IIgAxgHLD0KLbTWr" /></figure><ul><li>ตรวจสอบสถานะของงาน model monitor จะต้องได้ผลลัพธ์ Scheduled</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*LHrPltZ96umUqfa_" /></figure><ul><li>ตรวจสอบทุก 10 นาที หากมีการ Monitor แล้วจะมี Output</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/0*4UUSnqtls0ytDMc5" /></figure><ul><li>คลิก Monitoring job history พบว่าสถานะการตรวจสอบเป็น In progress</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*xt1v9v0nz05lR7wY" /></figure><ul><li>เมื่อทำงานเสร็จสิ้น สถานะการตรวจสอบกลายเป็น Issue Found</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*HnvxwoR6e-YlK2AP" /></figure><ul><li>คลิก double ที่ Issue found เพื่อดูรายละเอียด จะเห็นว่าการตรวจสอบ model ตรวจพบ baseline drift ขนาดใหญ่ใน EDUCATION และ BILL_AMT2 fields ที่แก้ไข้ก่อนหน้านี้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/0*byTy5ezh_aNksyPh" /></figure><ul><li>แสดง Output จาก Model Monitor</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/0*nw45tDPKxs9mMbko" /></figure><ul><li>ดูรายงานที่สร้างขึ้นโดย Model Monitor จะพบว่านอกจาก statistics.json และ constraints.json แล้ว ยังมีไฟล์ใหม่ที่สร้างขึ้นชื่อ constraint_violations.json เนื้อหาไฟล์นี้แสดงอยู่ด้านบนใน Amazon SageMaker Studio</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/0*htWpWXLpynq8-65c" /></figure><p><strong>Step 10 Clean up</strong></p><ul><li>ลบ Monitoring Schedules</li></ul><blockquote>ไม่สามารถลบ endpoint ของ Monitor Model จนกว่างาน Monitorทั้งหมดที่เชื่อมโยงกับ endpoint จะถูกลบออก</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4F24Bwt9MpWUkF2k" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*KzLCsZtF24dfAnHV" /></figure><ul><li>ลบ endpoint</li></ul><blockquote>ตรวจสอบให้แน่ใจว่าได้ลบงาน Monitorทั้งหมดที่เชื่อมโยงกับ endpoint ออกก่อน</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5FhlCahl5oa1jw0z" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/0*ELycm_KMYsVc4CJI" /></figure><ul><li>ถ้าต้องการล้างข้อมูลการ train ทั้งหมด (models, preprocessed dataset ฯลฯ)</li></ul><blockquote>ตรวจสอบให้แน่ใจว่า หมายเลขบัญชี ได้แทน ACCOUNT_NUMBER</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7Oyx-AjSu08eoNqF" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/0*IaUl3FgxxNVMC8wJ" /></figure><h4>❤️️<strong>How does design Well Architected Framework with Amazon SageMaker Studio?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/0*-DefnFlzKF0Ya_W5" /></figure><h4>❤️️<strong>How does design Well Architected Framework with Amazon SageMaker Studio?</strong></h4><ul><li><strong>Operational Excellence</strong><br>SageMaker Studio Notebook สามารถใช้ code ดำเนินงานกับ AWS หลายอย่างได้อย่างรวดเร็ว เช่น run code สร้าง S3 Bucket, upload dataset ไปที่ S3 bucket นอกจากนี้ยังมี CloudWatch สามารถตรวจสอบ Amazon SakeMaker รวบรวมข้อมูลดิบและประมวลผลลงใน metric ที่อ่านได้ใกล้กับ metric แบบ realt time เพื่อให้สามารถเข้าถึงข้อมูลย้อนหลัง และเห็นภาพรวมวิธีการทำงานของ web application หรือการบริการ AWS</li><li><strong>Security<br></strong>SageMaker Studio มีการกำหนดสิทธิ์การจัดการเข้าถึง AWS SageMaker, S3 bucket และได้สร้าง IAM Role ที่แนบ Policy เพื่อเข้าถึงและ Upload ข้อมูลลงใน S3 bucket อย่างปลอดภัย และเพิ่มการป้องกันในระดับพิเศษที่นอกจาก user และ password โดยใช้ MFA</li><li><strong>Reliability<br></strong>SageMaker Studio มีการสร้าง endpoints ที่แกร่งเมื่อ host ไปที่โมเดล เพื่อให้ SageMaker endpoints ช่วยป้องกัน application จากความล้มเหลวของ AZ และ Instance หากเกิดขัดข้อง หรือ Instance ล้มเหลว SageMaker จะกระจาย Instance อัตโนมัติใน AZ หลายๆที่</li><li><strong>Performance Efficiency<br></strong>SageMaker Studio มี Feature มากมาย เช่น SageMaker Experiments สามารถติดตาม ประเมินความถูกต้อง บันทึกผลกระทบของ Algorithms และ Hyperparameers ของข้อมูลแต่ละโมเดลฝึกฝน ส่วน SageMaker Model Monitor สามารถจับภาพ input, output, metada สำหรับการเรียกใช้โมเดลที่ปรับใช้ ยังช่วยให้สามารถวิเคราะห์ข้อมูลและตรวจสอบคุณภาพของข้อมูลได้ หากข้อมูลผิดปกติ จะมีการแจ้งเตือนผู้ใช้ให้รักษาความถูกต้องของโมเดล</li><li><strong>Cost Optimization<br></strong>SageMaker Studio ช่วยลดค่าใช้จ่ายในการซื้อคอมพิวเตอร์ที่มีประมวลสูงในการทำงาน ML พื้นที่จัดเก็บข้อมูลมหาศาล การบำรุงรักษาระบบ</li></ul><p>❤️️<strong>Conclusion</strong></p><p>การจัดทำโครงงานนี้เพื่อศึกษาการทำงานของ Amazon SageMaker Studio ในการสร้าง ฝึกฝน ปรับใช้ ตรวจสอบ ML จากการตั้งค่า Configuration ของ SageMaker Studio ให้ได้สร้าง IAM Role ให้สิทธิ์การเข้าถึง S3 bucket และ SageMaker Studio เพื่อสามารถ download และ import dataset ใน Studio แล้วส่งข้อมูลไปที่ S3 bucket นำข้อมูลมาเลือก features ด้วย SageMaker Processing แล้วไปฝึกฝนโมเดล ทดสอบประสิทธิภาพ ปรับใช้โมเดล และตรวจสอบโมเดล โดยใช้ features ต่างๆ ของ SageMaker Studio จากการดำเนินงานการจัดการทรัพยากรทั้งหมดโดยพิมพ์ code ใน Studio Notebook ทำให้มีความสะดวกในการใช้บริการทำ ML ที่เดียวกัน ลดขั้นตอนการใช้บริการ AWS ลดค่าใช้จ่ายในทำ ML เช่น เครื่องคอมพิวเตอร์ พื้นที่จัดเก็บข้อมูล การบำรุงรักษาระบบ</p><p>❤️️<strong>Impacts</strong></p><p><strong>Possitive</strong></p><ul><li>มีความสะดวกในการทำ ML โดยใช้เครื่องมือเดียว SageMaker</li><li>สามารถเลือก Server หลายเครื่องสําหรับการฝึกอบรม</li><li>ลดค่าใช้จ่ายในการซื้อทรัพยากรที่ประกอบการทำ ML</li><li>จ่ายเฉพาะสําหรับสิ่งที่ใช้และระยะเวลาที่เราใช้</li></ul><p><strong>Negative</strong></p><ul><li>อาจใช้เวลานานในการทํางานกับข้อมูลมหาศาล</li><li>ผู้ใช้งานต้องมีความเชี่ยวชาญด้านการเขียนโปรแกรม</li><li>หากใช้ปริมาณงานจำนวนมาก อาจมีค่าใช้จ่ายในการใช้บริการสูง</li></ul><p>❤️️<strong>Commercialization Use Cases</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/0*yq58tc-EwIP7iuyv" /></figure><p>แหล่งข่าวและข้อมูลชั้นนำของโลกสำหรับตลาดมืออาชีพ ได้ใช้ Amazon SageMaker ทำให้สามารถออกแบบความสามารถใน NLP ในบริบทของ application การตอบคำถาม สามารถกำหนดค่าการเรียนรู้เชิงลึกซ้ำ ๆ ได้หลายครั้ง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/0*uWIJ9r7mh68-_q_e" /></figure><p>บริษัทเทคโนโลยีการแพทย์ Amazon SageMaker ช่วยให้เข้าถึงเครื่องมือและบริการ AI ที่มีประสิทธิภาพเพื่อปรับปรุงการดูแลผู้ป่วยให้ดียิ่งขึ้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/0*EAJ58pzqLibnIPox" /></figure><p>แบรนด์ที่พักชั้นนําระดับโลกที่ดําเนินงานเว็บไซต์แปลเป็นภาษาท้องถิ่น 90 แห่งใน 41 ภาษา Amazon SageMaker ช่วยให้สร้างแบบจําลองที่แม่นยํายิ่งขึ้นในชุดข้อมูลที่ใหญ่ที่สุดของเราได้อย่างรวดเร็ว ลดเวลาในการเคลื่อนย้ายแบบจําลองไปยังการผลิต ลดความซับซ้อนของ ML ได้อย่างมาก ทําให้สามารถสร้างประสบการณ์ที่ดีขึ้นให้กับลูกค้าได้อย่างรวดเร็ว</p><p>❤️️<strong>ขอบคุณสำหรับบทความดีๆ :))</strong></p><ul><li><a href="https://aws.amazon.com/th/getting-started/hands-on/build-train-deploy-monitor-machine-learning-model-sagemaker-studio/">Build, train, deploy, and monitor a machine learning model with Amazon SageMaker Studio</a></li><li><a href="https://aws.amazon.com/th/sagemaker/customers/">Amazon SageMaker Customers — Amazon Web Services (AWS)</a></li><li><a href="https://kingsubham27.medium.com/build-train-deploy-machine-learning-models-using-aws-sagemaker-4ad682acf1cd">Build, Train, Deploy Machine Learning Models using AWS SageMaker | by Subham Sarkar | Medium</a></li><li><a href="https://www.youtube.com/watch?v=8Vj7OaR4DcA">AWS SageMaker Tutorial | Introduction To AWS SageMaker | AWS Training | Edureka — YouTube</a></li><li><a href="https://docs.aws.amazon.com/sagemaker/latest/dg/studio-ui.html">Amazon SageMaker Studio UI Overview — Amazon SageMaker</a></li><li><a href="https://www.infoworld.com/article/3534699/review-amazon-sagemaker-plays-catch-up.html">Review: Amazon SageMaker plays catch-up | InfoWorld</a></li><li><a href="https://www.facebook.com/datasciencechill/posts/785268015191591/">(2) Data TH.com — Data Science ชิลชิล — โพสต์ | Facebook</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5e1a9c9fcfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[อะไรไม่จำเป็น ก็ทิ้งไป]]></title>
            <link>https://pariyanuchprasertsirikul.medium.com/%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3%E0%B9%84%E0%B8%A1%E0%B9%88%E0%B8%88%E0%B8%B3%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99-%E0%B8%81%E0%B9%87%E0%B8%97%E0%B8%B4%E0%B9%89%E0%B8%87%E0%B9%84%E0%B8%9B-3caf6d1bf4cc?source=rss-5c168caa7ce3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3caf6d1bf4cc</guid>
            <dc:creator><![CDATA[SUNG]]></dc:creator>
            <pubDate>Fri, 10 Apr 2020 07:39:27 GMT</pubDate>
            <atom:updated>2020-04-10T07:39:27.747Z</atom:updated>
            <content:encoded><![CDATA[<p>ขอบคุณคุณแม่ที่ซื้อหนังสือให้ เป็นเล่มสุดท้ายที่ได้มาก่อนแม่จากไป นี่คือบทความนี้ครั้งแรกของลูกที่คัดบทมาสรุปคราวๆ อาจจะไม่ perfect</p><p>และขอบคุณผู้เขียนหนังสือ ผู้เบื้องหลังที่ทำให้ได้เล่มนี้ และผู้อ่านทุกท่าน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCl0BY3Tpzaz9fqT9AlMSQ.jpeg" /></figure><p>เรามารู้จักคำว่า “มินิมัล” ก่อน สำหรับผู้อ่านที่ไม่คุ้นเคย หรือทราบมาก่อนแล้ว ก็คือการลดข้าวของให้เหลือของที่จำเป็นจริงๆ ไว้ให้ดูเรียบง่าย โล่งสบายตา</p><p>อย่างเช่น Steve Jobs ที่ไม่มีใครไม่รู้จัก เป็นผู้คิดค้นสมาร์ทโฟน หน้าจอโฟนมีเพียงไม่กี่ปุ่ม สามารถเก็บคลังความรู้ รูปภาพ ดูหนัง เล่นเกม ต่างๆ เขายังทำให้แทบทุกกิจกรรมโดยพกสมาร์ทโฟนเพียงชิ้นเดียว นี่แหละตรงที่มีความมินิมัล</p><p>ความเคยชินที่มักเกิดขึ้นหลังจากได้สิ่งที่ปรารถนาด้วยความดีใจอย่างที่เวลาซื้อของใหม่ที่อยู่กับเราหลายๆครั้ง จนไม่ค่อยรู้สึกเท่าสิ่งที่ซื้อมาวันนั้น ทำให้มีความเคยชิน แล้วค่อยๆ เป็นความธรรมดา และนำไปสู่ความเบื่อหน่าย ทำให้ไม่มีความสุข ทั้งๆที่ความปรารถนาอยู่ตรงนี้เป็นจริงแล้ว ดังนั้น ต้องรู้จักพอใจในสิ่งที่มีอยู่อย่างมีความสุข อย่างนั้นถ้าไม่รู้จักกับความเคยชิน คงดีไม่น้อย ก่อนซื้อข้าวของเข้าห้อง ทวนให้ดีก่อนว่าสิ่งนั้นมีความจำเป็นจริงๆ หรือไม่สำหรับปัจจุบัน อย่าเผื่ออนาคตหากไม่ใช่สถานการณ์เร่งด่วนจริงๆ ที่หาซื้อยากมากๆ หรืออดีตที่ไม่ได้ใช้แล้ว ที่ไม่จำเป็นจริงๆ</p><p>คนเรามักมีความเคยชินกับสิ่งของ ไม่ว่าสิ่งนั้นเป็นอะไรก็ตาม ดังนั้น ประสบการณ์เป็นสิ่งที่มีความต่อเนื่องของระยะเวลาแห่งความสุขยาวนานกว่าสิ่งของ เพราะการเปรียบเทียบประสบการณ์ของคนเป็นสิ่งที่ยากกว่าเปรียบเทียบสิ่งของ เพราะประสบการณ์ในแต่ละคนจะไม่รู้ประสบการณ์ทั้งหมดของอีกฝ่าย จึงต้องใช้พลังงานในการจินตนนาการ ดังนั้น ลงมือให้มากขึ้นเพื่อสั่งสมประสบการณ์ให้สุขใจ</p><p>ยินดีรับคำติชมนะคะ เรามาพัฒนาตนเองไปด้วยกัน โลกจะได้พัฒนาด้วยกัน ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3caf6d1bf4cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>