> For the complete documentation index, see [llms.txt](https://docs.aic-eec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aic-eec.com/artificial-intelligence-ai/machine-learning/dataset.md).

# Dataset

## การแบ่งชุดข้อมูล (Dataset)

### ชุดข้อมูลคืออะไร

ชุดข้อมูลคือ กลุ่มของข้อมูลที่มีการใช้ตัวแปรบางอย่างร่วมกัน โดยจะแบ่งตัวแปรแต่ละตัวเป็นคอลัมบ์ ตามตัวอย่างที่ผ่านมาด้านบน ซึ่งตัวแปรที่ชุดข้อมูลใช่ร่วมกันคือ time stamp และมีตัวแปรอื่นๆคือ acc\_x, acc\_y และ acc\_z ชุดข้อมูลนั้นไม่จำเป็นต้องอยู่ในรูปแบบ time series เสมอไป ดังนั้นการจัดแบ่งชุดข้อมูลจะเปลี่ยนไปตามประเภทของข้อมูล

ตัวอย่างชุดข้อมูล

| timestamp | acc\_x | acc\_y | acc\_z | date                |
| --------- | ------ | ------ | ------ | ------------------- |
| 5260      | -114   | -1469  | 9030   | 03/03/2022 11:21:42 |
| 5261      | -129   | -985   | 9724   | 03/03/2022 11:21:42 |
| 5262      | -315   | -646   | 10088  | 03/03/2022 11:21:42 |
| 5263      | -248   | 985    | 9298   | 03/03/2022 11:21:42 |
| 5264      | -521   | 1048   | 10581  | 03/03/2022 11:21:42 |

<br>

### ทำไมต้องแบ่งชุดข้อมูล

โดยปกติแล้วชุดข้อมูลส่วนใหญ่จะถูกแบ่งเป็นส่วนๆอยู่แล้ว เช่น แบ่งตามวัน, เดือน, กลุ่มต่างๆ แต่การแบ่งชุดข้อมูลในที่นี้สื่อถึงการแบ่งชุดข้อมูลสำหรับการนำไปทำ Machine learning ซึ่งจะแบ่งเป็นชุดข้อมูลที่ไว้สำหรับสอน (train)<br>

<figure><img src="/files/NWQNKrwk3cGQe58H6uGd" alt=""><figcaption></figcaption></figure>

### แบ่งชุดข้อมูลแล้วเอาไปทำอะไรต่อ

เมื่อแบ่งชุดข้อมูลเรียบร้อยแล้ว เราจะนำข้ออมูลชุดนี้เพื่อนำไปให้ Machine learning(ML) โดยตัว ML นั้นจะนำข้อมูลถูกแบ่งไว้ว่าเป็นข้อมูลชุด Train มาทำการเรียนรู้เพื่อหา feature ต่างๆของข้อมูลชุดนั้นโดยขึ้นอยู่กับ Algorithm ว่าจะดูเอกลักษณ์อะไรของชุดข้อมูลนั้นเมื่อ ML เรียนรู้เสร็จแล้วจะได้สิ่งที่เรียกว่า Model ออกมาหลังจากนั้น ML จะนำข้อมูลชุด Test มาป้อนข้อมูลใส่ Model ที่เราได้มาเพื่อทดสอบความแม่นยำของชุดข้อมูลที่เราเรียนรู้ไปว่ามีถูกผิดกี่เปอเซนต์<br>

<figure><img src="/files/bt9VUiJBrv5sWRe9b4Wi" alt=""><figcaption></figcaption></figure>

อ้างอิง :

{% embed url="<https://sdsclub.com/how-to-train-and-test-data-like-a-pro/>" %}

Last update: May 2023

Author: Thanaluk Pranekunakol (AIC-Researcher)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.aic-eec.com/artificial-intelligence-ai/machine-learning/dataset.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
