<?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 Nattapong Soponwattana on Medium]]></title>
        <description><![CDATA[Stories by Nattapong Soponwattana on Medium]]></description>
        <link>https://medium.com/@nattapongsoponwattana?source=rss-4ab205ec9a7e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4HXREfdXKUrm0fxT.</url>
            <title>Stories by Nattapong Soponwattana on Medium</title>
            <link>https://medium.com/@nattapongsoponwattana?source=rss-4ab205ec9a7e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 15:45:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nattapongsoponwattana/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[Sentiment Analysis คืออะไร ?]]></title>
            <link>https://medium.com/@nattapongsoponwattana/sentiment-analysis-%E0%B8%84%E0%B8%B7%E0%B8%AD%E0%B8%AD%E0%B8%B0%E0%B9%84%E0%B8%A3-d3a17445cf74?source=rss-4ab205ec9a7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3a17445cf74</guid>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nattapong Soponwattana]]></dc:creator>
            <pubDate>Wed, 06 Nov 2019 15:20:26 GMT</pubDate>
            <atom:updated>2019-11-06T17:31:45.826Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sentiment Analysis คืออะไร ?</h3><blockquote><strong>คือ “การวิเคราะห์ความรู้สึก”</strong></blockquote><blockquote><strong>เป็นการวิเคราะห์อารมณ์และความรู้สึกจากข้อความ เพื่อบ่งบอกความรู้สึกของผู้คนที่มีต่อบางสิ่งบางอย่าง แบ่งได้เป็น</strong></blockquote><p>Positive = เป็นในทางที่ดี</p><p>Negative = เป็นในทางที่ไม่ดี</p><p>Neutral = เป็นกลาง</p><p>เช่น เขาเป็นคนดี ชอบช่วยเหลือผู้อื่น เป็นข้อความแบบ <strong>Positive</strong></p><h4>เราจะทำโดยใช้ ภาษา python ในการจัดการ</h4><blockquote><strong>ขั้นตอนเเรก เราจะ import เครื่องมือที่จำเป็นมาก่อน</strong></blockquote><blockquote><strong>Tokenization คือ การนำข้อความมาตัดคำ ออกเป้นคำย่อย ๆ เรียกว่า Token</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5PvrrXEfC38dX_aTXxY3Ow.png" /></figure><blockquote><strong>Load Data ที่เตรียมไว้</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gqPpqFGj_WlyiJPDa8HLpQ.png" /></figure><blockquote><strong>ดูข้อมูลสรุปและรายละเอียด Data</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*BsjNNQD8RD4jpLVUAOUHxA.png" /></figure><blockquote><strong>ถัดมาจะมาดูกราฟว่า Positive,Negative,Neutral มีปริมาณเท่าใด</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*ohAGsEXntOvbs_E0_f2gIg.png" /></figure><blockquote><strong>ทดสอบการตัดคำ</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*_OfoezHJdRr7EaZwWjUgtg.png" /></figure><blockquote><strong>หาความยาวของรูปประโยคจาก Data ที่เรานำเข้ามา</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*yqgPRQm3wfvfGpYYZuNIjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWINEIKwEx1lD3HRqefP_g.png" /></figure><blockquote><strong>แบ่งกลุ่มโดยวาดเป็นกราฟ</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*iZq8NDWGqA-R2yoOZF4ang.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*xpGvV5KKaMYhpG7037EdYQ.png" /></figure><blockquote><strong>เราลองมาดูข้อมูลของคลาส pos (Positive)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*4mdTuOq0w4Y2SOVl7LdDuA.png" /></figure><p>นอกจากนี้เรายังมี class neg(Negative),neu(Neutral)</p><blockquote><strong>เอา class ทั้ง 3 มารวมกัน</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*OwR6C4l5E4b4lL1CVFUWKQ.png" /></figure><blockquote><strong>มาถึงส่วนที่สำคัญคือการบอกว่าใน class เป็นคำประเภทไหน</strong></blockquote><p>อย่างเเรก import สิ่งที่ต้องใช้มาก่อนในรูป</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*InqkKuAzY2NCIIO_L76EHw.png" /></figure><blockquote><strong>แสดง Data</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*yKST7BeuwAjnn-kUYqX8Jg.png" /></figure><blockquote><strong>สร้าง Model เพื่อทดสอบหาคำที่ใกล้เคียงกลุ่มเดียวกัน</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*DkfEI4_BdGAhb5wPLdYJKQ.png" /></figure><blockquote><strong>ความใกล้เคียงของคำสองคำเลขร้อยละ</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*NQT4zwrj94p08UJ7yH3FZw.png" /></figure><blockquote><strong>ค้นหาคำที่ใกล้เคียงที่สุด</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*nU7uhKP51td7nirGldA97A.png" /></figure><blockquote><strong>สร้างผลเฉลยเอาไว้</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*dyF3TFfGbRrUi7BSisZ4Vw.png" /></figure><blockquote><strong>ใช้ OneHot แปลงผลเฉลยเป็นตัวเลข</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIPvUx46HkmJHdwzuMcu0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*ctPvaVppUdJvfxfaCXJA1w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*9zkOkjFUE2j3-jyoPGQu9w.png" /></figure><blockquote><strong>ถัดมาถ้าเรามีประโยคจะแปลงเป็นตัวเลขโดยใช้</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*FDPUGYS6z390csTMaW-IPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*qIF5UEQXCZmZHW5HTBK2pg.png" /></figure><blockquote><strong>สร้าง Model เพื่อ Train</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*3QPZFY_rqDGMNnDATHadiA.png" /></figure><blockquote><strong>ลอง train และทดสอบความเเม่นยำดู</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*ylt6byh3L43t6sNLB3y-pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*8YT8f0_qW1B733ai78El6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*Yfe0SQk7ggsOaJsaqYwjXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*SiFDvwWrz8lH_0nK1mkIHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*dcXx90zwzM80HDkcVtznvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*u-NCxD4irmrugQn8mq9QEw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3a17445cf74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Confusion Matrix]]></title>
            <link>https://medium.com/@nattapongsoponwattana/confusion-matrix-7cfd45173fbd?source=rss-4ab205ec9a7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cfd45173fbd</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[confusion-matrix]]></category>
            <dc:creator><![CDATA[Nattapong Soponwattana]]></dc:creator>
            <pubDate>Thu, 03 Oct 2019 14:03:50 GMT</pubDate>
            <atom:updated>2019-10-03T14:03:50.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*Wnsh-q_zgPEAglxU-UoWFw.png" /></figure><blockquote><strong>Confusion Matrix เป็นวิธีการคำนวณประสิทธิภาพในการทำนาย (predict) ที่เปรียบเทียบกับค่าจริงของข้อมูลโดยจะมีค่าที่เกี่ยวข้องดังนี้</strong></blockquote><p><strong>True Positive </strong>(TP) คือ ค่าที่ทำนายว่าจริง และข้อมูลเป็นจริง<br><strong>True Negative</strong> (TN) คือ ค่าที่ทำนายว่าจริง แต่ข้อมูลเป็นเท็จ<br><strong>False Positive</strong> (FP) คือค่าที่ทำนายว่าจริง เเต่ข้อมูลเป็นเท็จ<br><strong>False Negative </strong>(FN) คือค่าที่ทำนายว่าเท็จ เเต่ข้อมูลเป็นจริง</p><ul><li><strong>Acurracy คือ ค่าความแม่นยำถูกต้องในการทำนายมีสูตรคำนวณคือ accuracy = correct predictions / total predictions หรือ<br> (TP+TN)/(TP+TN+FP+FN)</strong></li><li><strong>Precision คือ เรามีข้อมูลเป็น Positive เเต่ทำนายได้เป็น Negative จะได้ สูตรดังนี้ Precision = TP/(TP+FP) เราจะเลือกสิ่งที่สนใจเป็น positive</strong></li></ul><p><strong>EX. เช่นเรามี E-mail ปกติแต่ผลทำนายออกมาว่า E-mail นี้เป็นสแปม</strong></p><ul><li><strong>Recall คือ เรามีข้อมูลที่เป็น Negative แต่การทำนายได้เป็น Positive จะได้สูตรดังนี้ Recall = TP/(TP+FN)</strong></li></ul><p><strong>Ex.มีผลตรวจว่าติดเชื้อ HIV แต่ผลการทำนายบอกว่าไม่ติดเชื้อ</strong></p><ul><li><strong>F1 Score คือ ค่าเฉลี่ยของ Precision และ Recall จะได้สูตรคำนวณดังนี้ F1-score = 2 x (Precision x Recall)/(Precision + Recall)</strong></li></ul><blockquote><strong>ตัวอย่างการใช้วิธี Confusion Matrix</strong></blockquote><p>เราจะใช้ข้อมูล men - women ในการทำนาย ทางขวา predicted คือการทำนาย จะเห็นว่าถูกต้อง 7 และผิด</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*r_Mz0ujbToDUb93i-EgeOQ.png" /></figure><blockquote><strong>หาค่า accuracy (คิดเป็น % ร้อยละโดย *100)</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*cHAvx2hT_qVfCoQP_xMKkA.png" /></figure><blockquote><strong>ค่าแบบ Confusion Matrix</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*id1fPWSqTlrrbaQ7aW3AzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*oYGXl6GfW5Li-aLkpODCdA.png" /></figure><blockquote><strong>F1-score</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*_JKajgS4TGXG_2bkWFQP3Q.png" /></figure><blockquote><strong>แสดงผลค่า Accuracy, Precision, Recall แบบร้อยละ</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*SXGwV-ecaUa32UoX6GGP5A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cfd45173fbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[การทำนายข้อมูลของ AI โดย Keras และ Pytorch]]></title>
            <link>https://medium.com/@nattapongsoponwattana/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%97%E0%B8%B3%E0%B8%99%E0%B8%B2%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5%E0%B8%82%E0%B8%AD%E0%B8%87-ai-%E0%B9%82%E0%B8%94%E0%B8%A2-keras-%E0%B9%81%E0%B8%A5%E0%B8%B0-pytorch-ac9e3f94da4c?source=rss-4ab205ec9a7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9e3f94da4c</guid>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Nattapong Soponwattana]]></dc:creator>
            <pubDate>Sun, 08 Sep 2019 15:05:56 GMT</pubDate>
            <atom:updated>2019-09-08T15:05:56.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*INFOm8mWmwNGVuYmxABBeQ.png" /></figure><p>เรามาทำความรู้จักกับ <strong>Keras</strong> กันก่อน</p><p><strong>Keras</strong> คือ <strong>deep learning framework </strong>สำหรับ python ที่ทำให้วิธีของเทรน โมเดลด้วย deep learning ง่ายขึ้น โดยข้อดีของมันคือ</p><ul><li>Code ไม่ซับซ้อนเหมือนการใช้ Tensorflow โดยตรง</li><li>Keras อนุญาติให้ใช้ code เดียวกันในการรันทั้ง cpu และ gpu ได้เหมือนกัน</li><li>- API ง่ายต่อการใช้งานและทำให้ ตัวต้นแบบในการสร้าง deep learning model เสร็จเร็ว</li></ul><p><strong>เริ่มต้นใช้งาน (เราจะใช้ชุดข้อมูล Weather.csv ที่เตรียมไว้ในการเทรนข้อมูล)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*La66BDBndiQqRFgOrv9L1w.png" /></figure><p><strong>ค่า Root Mean Sqaured Eror</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*wCgQnwXVtPY7ICNX0DBAng.png" /></figure><p><strong>Model Keras</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*BERaBGpKURCQCwoUbgSGoQ.png" /></figure><h4>Compile Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*hdEUU6pO9vO3O-l3HNn8Tg.png" /></figure><p>เริ่ม <strong>Train</strong> จำนวน <strong>5000</strong> รอบ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*8Q6fFS16trBcliOXflBjEg.png" /></figure><p>เราจะพลอตกราฟออกมาดูจะได้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*Fz63TzSQcA1RTm03qPmoSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*drNhEXKGNCA-jjPILb-6FQ.png" /></figure><p><strong>ต่อมาให้ทำนาย</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*OAS973KbymcB_gM3Qp6GXg.png" /></figure><p><strong>และแปลงเป็น DataFrame</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*mrrmT7uePJvnbz_1vziE9g.png" /></figure><h4>เปรียบเทียบผลการทำนายกับค่าจริง</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*9xRpFnzKdFQkl9IFIO72Ew.png" /></figure><p>และ<strong> Plot test data และ Model (สมการเส้นตรง) และเเสดงผลค่า eror ออกมา</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*75r1l5-IXowZ9s2DR9-h4w.png" /></figure><h3><strong>อีกตัวที่เราจะพูดถึงก็คือ Pytorch</strong></h3><p>PyTorch เป็น Deep Learning Library ซึ่ง Facebook พัฒนาบนภาษา Python จุดเด่นอยู่ที่การทำ Dynamic Computation และระบบการหาอนุพันธ์แบบ Automatic Differentiation</p><p><strong>เริ่มต้นเรียกใช้งาน</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*Vs-BxVMgaMW8aMgOMZ3Ynw.png" /></figure><p>ตัว Model และ learning rate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*MxsmnsJkzG9hVu7_BjkvWg.png" /></figure><p><strong>เริ่ม Train</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*WOliFiqbhJdpAdb_7RP5Wg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*qsdPZmRX9a7F2nWxgsH1nQ.png" /></figure><p><strong>การทำนายผล และแปลงเป็น DataFrame</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*g-n4HnCQjp5iwuq8QlgD2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*an5555tzHXEmlKxAX3mH9w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*Go74STvxwy0nh6vxLaSB2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*LLa17brwfU3HFQq8Y431Kw.png" /></figure><p><strong>PlotGraph ออกมาดู และเเสดงผลค่า Eror</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*arSqwvkz81Hb3j9VBeUdLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*QxAvNhKh1hyBtB9rfy-RJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*E0Z4Id71nS0WFHeTMYbanQ.png" /></figure><p><strong>จากการที่เราได้ทำนายโดยใช้ Keras เเละ Pytorch นั้นจะพบว่าตัว Pytorch จะมีค่า MSE(Mean Squared Eror) มากกว่า Keras อยู่มาก แต่ก็ขึ้นอยู่กับจำนวนรอบในการ Train ถ้าเราเพิ่มค่าการ Train ให้ Pytorch ค่า MSE อาจจะดีขึ้นก็ได้</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9e3f94da4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Problem Solving as Search]]></title>
            <link>https://medium.com/@nattapongsoponwattana/problem-solving-as-search-2113a29b5ff?source=rss-4ab205ec9a7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2113a29b5ff</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[tecnology]]></category>
            <dc:creator><![CDATA[Nattapong Soponwattana]]></dc:creator>
            <pubDate>Thu, 01 Aug 2019 15:27:52 GMT</pubDate>
            <atom:updated>2019-08-01T15:27:52.526Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>การแก้ปัญหาด้วยวิธีการ serch ที่นำมาใช้กับ AI (A</strong>rtificial Intelligence<strong>)</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8FQ83PA0FwNJZ2MI" /><figcaption>Photo by <a href="https://unsplash.com/@franckinjapan?utm_source=medium&amp;utm_medium=referral">Franck V.</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>โดยหลักการในการใช้แก้ปัญหา เราจะใช้ความรู้จาก Data Structure ในเรื่องของ Tree Search และ Graph</p><h4><strong>EX1</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*Cf4tpyOQbKA6KAQwtjhjQA.png" /></figure><ul><li>สมมิมีตัวละคร 4 ตัว คือ มนุษอวกาศ สุนัขจิ้งจอก ห่าน ธัญพืช ให้หาวิธีพาทั้งหมดข้ามไปอีกฝั่งชองแม่น้ำโดยมีเงื่อนไขคือ</li><li>1.มนุษย์อวกาศจะพาข้ามได้ 1 สิ่งหรือข้ามไปคนเดียวได้</li><li>2.สุนัขจิ้งจอกจะกินห่านถ้าอยู่กัน 2 ตัว</li><li>3.ห่านจะกินธัญพืชถ้าไม่มีสิ่งอื่นอยู่ด้วย</li></ul><p>โดยเราจะต้องหาวิธีเพื่อไปถึงเป้าหมาย (Goal) โดยการหาขั้นตอนที่เป็นไปได้ทีละขั้นเป็นลำดับจนบรรลุ เป้าหมายดังภาพ</p><h3><strong>การ Serch ที่เราใช้หลักๆมี 4 วิธี</strong></h3><ul><li><strong>DFS (Depth first search) การค้นหาเเบบเเนวลึกก่อน</strong></li></ul><p>เป็นการหาเป้าหมายโดยเริ่มจาก node ทางซ้ายจนจะเจอเป้าหมายหรือไม่มี node ลูกเเล้ว</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*digBvV2fSQWKzlw8TKe_jw.png" /></figure><ul><li><strong>BFS (Breadth-First Search) การค้นหาในเเนวกว้าง</strong></li></ul><p>เป็นการค้นหาใน level เดียวกันก่อนเริ่มจากทางซ้ายจนกว่าจะเจอเป้าหมาย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*s0X2lYDAMzKeRtvceqD_uQ.png" /></figure><ul><li><strong>heuristic search</strong></li></ul><p>วิธีการนี้เลือกคำตอบที่เหมาะสมให้กับการค้นหาเท่านั้น แต่ไม่ได้คำตอบที่ดีที่สุด เหมาะในการใช้กับข้อมูลมากๆ</p><ul><li><strong>A* Serch</strong></li></ul><p>เป็นวิธีที่ใช้หาเป้าหมายที่ดีที่สุด และเหมาะสมที่สุด โดยจะมีค่า cost เพื่อวัดค่าสถานะของขั้นตอนระหว่างจุดเริ่มต้น จนถึงเป้าหมาย ยิ่งค่า cost น้อยยิ่งดี จะมีสมการในการคำนวณคือ</p><p><strong>f(N) = g(N) + h(N), where:</strong></p><p><strong>• g(N) = cost of best path found so far to N</strong></p><p><strong>• h(N) = heuristic function</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*ljD417spUaqbndNlCd3r-A.png" /></figure><h3><strong>แหล่งข้อมูล</strong></h3><p>Slides adapted from: 6.034 Tomas Lozano Perez, Russell and Norvig AIMA</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2113a29b5ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>