@xdev-asia/xdev-knowledge-mcp 1.0.43 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/content/pages/xoa-du-lieu-nguoi-dung.md +68 -0
  2. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/01-bai-1-data-repositories-ingestion.md +5 -0
  3. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/02-bai-2-data-transformation.md +5 -0
  4. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/01-phan-1-data-engineering/lessons/03-bai-3-data-analysis.md +159 -0
  5. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/04-bai-4-sagemaker-built-in-algorithms.md +186 -0
  6. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/05-bai-5-training-hyperparameter-tuning.md +159 -0
  7. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/02-phan-2-modeling/lessons/06-bai-6-model-evaluation.md +169 -0
  8. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/07-bai-7-model-deployment.md +193 -0
  9. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/08-bai-8-model-monitoring-mlops.md +184 -0
  10. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/03-phan-3-implementation-operations/lessons/09-bai-9-security-cost.md +166 -0
  11. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/10-bai-10-bai-toan-thuong-gap.md +181 -0
  12. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/11-bai-11-cheat-sheet.md +110 -0
  13. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/chapters/04-phan-4-on-tap/lessons/12-bai-12-chien-luoc-thi.md +113 -0
  14. package/content/series/luyen-thi/luyen-thi-aws-ml-specialty/index.md +1 -1
  15. package/content/series/luyen-thi/luyen-thi-cka/index.md +217 -0
  16. package/content/series/luyen-thi/luyen-thi-ckad/index.md +199 -0
  17. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/01-phan-1-problem-framing/lessons/01-bai-1-framing-ml-problems.md +136 -0
  18. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/01-phan-1-problem-framing/lessons/02-bai-2-gcp-ai-ml-ecosystem.md +160 -0
  19. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/02-phan-2-data-engineering/lessons/03-bai-3-data-pipeline.md +174 -0
  20. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/02-phan-2-data-engineering/lessons/04-bai-4-feature-engineering.md +156 -0
  21. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/03-phan-3-model-development/lessons/05-bai-5-vertex-ai-training.md +155 -0
  22. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/03-phan-3-model-development/lessons/06-bai-6-bigquery-ml-tensorflow.md +141 -0
  23. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/04-phan-4-deployment-mlops/lessons/07-bai-7-model-deployment.md +134 -0
  24. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/04-phan-4-deployment-mlops/lessons/08-bai-8-vertex-ai-pipelines-mlops.md +149 -0
  25. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/05-phan-5-responsible-ai/lessons/09-bai-9-responsible-ai.md +128 -0
  26. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/chapters/05-phan-5-responsible-ai/lessons/10-bai-10-cheat-sheet-chien-luoc-thi.md +108 -0
  27. package/content/series/luyen-thi/luyen-thi-gcp-ml-engineer/index.md +1 -1
  28. package/content/series/luyen-thi/luyen-thi-kcna/index.md +168 -0
  29. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ ---
2
+ id: 019cb2b9-4dc7-72a5-956a-93f58cbac568
3
+ title: Xóa dữ liệu người dùng
4
+ slug: xoa-du-lieu-nguoi-dung
5
+ excerpt: Hướng dẫn yêu cầu xóa tài khoản và dữ liệu cá nhân trên xDev Asia.
6
+ featured_image: null
7
+ template: default
8
+ show_in_header: false
9
+ show_in_footer: true
10
+ sort_order: 12
11
+ meta:
12
+ meta_title: Xóa dữ liệu người dùng — xDev Asia
13
+ meta_description: Yêu cầu xóa tài khoản và toàn bộ dữ liệu cá nhân của bạn khỏi nền tảng xDev Asia.
14
+ published_at: '2026-04-05T00:00:00.000000Z'
15
+ ---
16
+
17
+ ## Xóa dữ liệu người dùng
18
+
19
+ Tại xDev Asia, chúng tôi tôn trọng quyền riêng tư và quyền kiểm soát dữ liệu cá nhân của bạn. Trang này hướng dẫn cách yêu cầu xóa tài khoản và toàn bộ dữ liệu liên quan.
20
+
21
+ ### Dữ liệu chúng tôi lưu trữ
22
+
23
+ Khi bạn sử dụng xDev Asia (website và ứng dụng di động), chúng tôi có thể lưu trữ:
24
+
25
+ - **Thông tin tài khoản:** Tên hiển thị, địa chỉ email, ảnh đại diện
26
+ - **Lịch sử học tập:** Bài học đã hoàn thành, tiến độ khóa học
27
+ - **Dữ liệu bookmark:** Bài viết và series đã lưu
28
+ - **Kết quả quiz:** Điểm số và lịch sử thi thử
29
+
30
+ ### Cách yêu cầu xóa dữ liệu
31
+
32
+ Bạn có thể yêu cầu xóa toàn bộ dữ liệu cá nhân theo một trong các cách sau:
33
+
34
+ **Cách 1: Qua email**
35
+
36
+ Gửi email đến **<admin@xdev.asia>a>a>a>** với tiêu đề **"Yêu cầu xóa tài khoản"** và nội dung bao gồm:
37
+
38
+ - Địa chỉ email đã đăng ký
39
+ - Tên hiển thị trên tài khoản
40
+ - Xác nhận bạn muốn xóa toàn bộ dữ liệu
41
+
42
+ **Cách 2: Qua GitHub**
43
+
44
+ Tạo một issue tại [github.com/xdev-asia-labs](https://github.com/xdev-asia-labs) với tiêu đề **"Data Deletion Request"**.
45
+
46
+ ### Thời gian xử lý
47
+
48
+ Chúng tôi sẽ xử lý yêu cầu trong vòng **30 ngày** kể từ khi nhận được. Sau khi hoàn tất, bạn sẽ nhận được thông báo qua email xác nhận dữ liệu đã được xóa.
49
+
50
+ ### Dữ liệu được xóa
51
+
52
+ Khi yêu cầu được chấp thuận, chúng tôi sẽ xóa:
53
+
54
+ - Tài khoản và thông tin cá nhân
55
+ - Lịch sử học tập và tiến độ
56
+ - Bookmark và dữ liệu tùy chỉnh
57
+ - Kết quả quiz và điểm số
58
+
59
+ **Lưu ý:** Một số dữ liệu đã được ẩn danh hóa và tổng hợp (ví dụ: thống kê lượt xem) có thể không bị xóa vì chúng không thể được liên kết lại với bạn.
60
+
61
+ ### Liên hệ
62
+
63
+ <admin@xdev.asia>
64
+ Nếu bạn có câ<admin@xdev.asia>riêng tư hoặc xử lý dữ liệu, vui lòng liên hệ:
65
+ <admin@xdev.asia>
66
+
67
+ - **Email:** <admin@xdev.asia>
68
+ - **Chính sách bảo mật:** [xdev.asia/pages/chinh-sach-quyen-rieng-tu/](/pages/chinh-sach-quyen-rieng-tu/)
@@ -17,6 +17,11 @@ course:
17
17
  slug: luyen-thi-aws-ml-specialty
18
18
  ---
19
19
 
20
+ <div style="text-align: center; margin: 2rem 0;">
21
+ <img src="/storage/uploads/2026/04/aws-mls-bai1-data-ingestion.png" alt="AWS ML Data Repositories & Ingestion" style="max-width: 800px; width: 100%; border-radius: 12px;" />
22
+ <p><em>Data Repositories & Ingestion: S3, Kinesis, Glue và Lake Formation trong ML pipeline</em></p>
23
+ </div>
24
+
20
25
  <h2 id="overview"><strong>1. Tổng quan Data Engineering trong MLS-C01</strong></h2>
21
26
 
22
27
  <p>Domain Data Engineering chiếm <strong>20% đề thi MLS-C01</strong>. Đây là phần bắt buộc phải nắm vững — đề thi thường hỏi "Which service should be used to ingest/store/transform data for ML?"</p>
@@ -17,6 +17,11 @@ course:
17
17
  slug: luyen-thi-aws-ml-specialty
18
18
  ---
19
19
 
20
+ <div style="text-align: center; margin: 2rem 0;">
21
+ <img src="/storage/uploads/2026/04/aws-mls-bai2-feature-engineering.png" alt="AWS ML Data Transformation Pipeline" style="max-width: 800px; width: 100%; border-radius: 12px;" />
22
+ <p><em>Feature Engineering & Data Transformation: Glue, SageMaker Data Wrangler, và xử lý missing values</em></p>
23
+ </div>
24
+
20
25
  <h2 id="overview"><strong>1. Data Transformation trong ML Pipeline</strong></h2>
21
26
 
22
27
  <p>Trước khi train model, raw data phải qua nhiều bước transformation. Đây là nguồn gốc của câu nói nổi tiếng: <em>"Garbage in, garbage out"</em>. Đề thi MLS-C01 thường hỏi kỹ thuật xử lý data và tools phù hợp.</p>
@@ -0,0 +1,159 @@
1
+ ---
2
+ id: 1a81b42d-c09e-43ef-b9f6-3158ca64b6c1
3
+ title: 'Bài 3: Data Analysis & Visualization'
4
+ slug: bai-3-data-analysis
5
+ description: >-
6
+ EDA trên SageMaker notebooks. Amazon Athena cho SQL analytics.
7
+ Amazon QuickSight cho BI dashboards. Phát hiện data quality issues.
8
+ Detect class imbalance, outliers, correlations, data drift.
9
+ duration_minutes: 45
10
+ is_free: true
11
+ video_url: null
12
+ sort_order: 3
13
+ section_title: "Phần 1: Data Engineering (20%)"
14
+ course:
15
+ id: 019c9619-lt02-7002-c002-lt0200000002
16
+ title: 'Luyện thi AWS Certified Machine Learning - Specialty'
17
+ slug: luyen-thi-aws-ml-specialty
18
+ ---
19
+
20
+ <div style="text-align: center; margin: 2rem 0;">
21
+ <img src="/storage/uploads/2026/04/aws-mls-bai3-eda-data-analysis.png" alt="Exploratory Data Analysis trên AWS" style="max-width: 800px; width: 100%; border-radius: 12px;" />
22
+ <p><em>EDA & Data Analysis: thống kê mô tả, phát hiện outliers, feature correlation trên AWS</em></p>
23
+ </div>
24
+
25
+ <h2 id="eda"><strong>1. Exploratory Data Analysis (EDA)</strong></h2>
26
+
27
+ <p><strong>EDA</strong> là bước phân tích dữ liệu ban đầu để hiểu structure, patterns, và anomalies trước khi modeling. SageMaker cung cấp nhiều tools để thực hiện EDA ở scale lớn.</p>
28
+
29
+ <h2 id="eda-tools"><strong>2. AWS Tools cho Data Analysis</strong></h2>
30
+
31
+ <table>
32
+ <thead><tr><th>Tool</th><th>Use Case</th><th>Interface</th></tr></thead>
33
+ <tbody>
34
+ <tr><td><strong>SageMaker Studio Notebooks</strong></td><td>Interactive EDA, Python/R analysis</td><td>JupyterLab-based IDE</td></tr>
35
+ <tr><td><strong>SageMaker Data Wrangler</strong></td><td>Visual data prep, 300+ transforms, auto-insights</td><td>Drag-and-drop GUI</td></tr>
36
+ <tr><td><strong>Amazon Athena</strong></td><td>SQL queries on S3 data</td><td>SQL console</td></tr>
37
+ <tr><td><strong>Amazon QuickSight</strong></td><td>BI dashboards, executive reports</td><td>Visual BI tool</td></tr>
38
+ <tr><td><strong>Amazon Redshift</strong></td><td>Large-scale data warehousing, SQL analytics</td><td>SQL</td></tr>
39
+ <tr><td><strong>AWS Glue DataBrew</strong></td><td>No-code data profiling và cleaning recipes</td><td>Visual tool</td></tr>
40
+ </tbody>
41
+ </table>
42
+
43
+ <blockquote>
44
+ <p><strong>Exam tip:</strong> <strong>Data Wrangler</strong> = visual data prep cho ML (generates SageMaker Processing code). <strong>DataBrew</strong> = data analyst/BI (no ML context). <strong>QuickSight</strong> = BI dashboards for business users, không phải ML.</p>
45
+ </blockquote>
46
+
47
+ <h2 id="data-quality"><strong>3. Data Quality Issues</strong></h2>
48
+
49
+ <p>Đề thi thường hỏi về nhận biết và xử lý các vấn đề chất lượng data phổ biến.</p>
50
+
51
+ <table>
52
+ <thead><tr><th>Issue</th><th>Detection Method</th><th>Impact on Model</th></tr></thead>
53
+ <tbody>
54
+ <tr><td><strong>Missing Values</strong></td><td>Null counts, missing rate per column</td><td>Errors, biased results</td></tr>
55
+ <tr><td><strong>Outliers</strong></td><td>Box plots, Z-score > 3, IQR method</td><td>Skewed weights, poor generalization</td></tr>
56
+ <tr><td><strong>Class Imbalance</strong></td><td>Class distribution histogram</td><td>Biased toward majority class</td></tr>
57
+ <tr><td><strong>Feature Correlation</strong></td><td>Correlation matrix, VIF score</td><td>Multicollinearity → unstable coefficients</td></tr>
58
+ <tr><td><strong>Data Leakage</strong></td><td>Features with suspiciously high correlation to target</td><td>Over-optimistic eval, fails in production</td></tr>
59
+ <tr><td><strong>Distribution Skew</strong></td><td>Histogram, skewness metric</td><td>Violated model assumptions</td></tr>
60
+ </tbody>
61
+ </table>
62
+
63
+ <h3 id="data-leakage"><strong>3.1. Data Leakage — Critical Concept</strong></h3>
64
+
65
+ <p><strong>Data leakage</strong> là khi information từ outside the training set rò rỉ vào features, khiến model có accuracy cao trong training nhưng thất bại khi production.</p>
66
+
67
+ <pre><code class="language-text">Common Data Leakage Patterns:
68
+
69
+ ❌ Target leakage:
70
+ Feature "loan_default_flag" → predicting "credit_risk"
71
+ (feature derived from target)
72
+
73
+ ❌ Future data leakage:
74
+ Using tomorrow's stock price to predict today's trade
75
+
76
+ ❌ Train/test contamination:
77
+ Scaling data BEFORE splitting (test mean leaks into train)
78
+
79
+ ✅ Correct approach:
80
+ Split data FIRST → fit scaler on train only → transform both
81
+ </code></pre>
82
+
83
+ <blockquote>
84
+ <p><strong>Exam tip:</strong> Always <strong>split before transforming</strong>. StandardScaler.fit() chỉ được gọi trên training set. Sau đó transform() trên cả train và test. Fit+transform trên toàn bộ dataset là data leakage.</p>
85
+ </blockquote>
86
+
87
+ <h2 id="athena"><strong>4. Amazon Athena</strong></h2>
88
+
89
+ <p>Athena cho phép chạy SQL queries directly trên S3 without loading data vào database. <strong>Pay per scan</strong> — tối ưu bằng cách dùng Parquet + partitioning.</p>
90
+
91
+ <pre><code class="language-text">Cost Optimization Tips:
92
+ ┌────────────────────────────────────────────────┐
93
+ │ Partition data by date/region/category: │
94
+ │ s3://bucket/data/year=2024/month=01/ │
95
+ │ → Query chỉ scan the required partitions │
96
+ │ │
97
+ │ Use columnar formats (Parquet/ORC): │
98
+ │ → Read only needed columns │
99
+ │ │
100
+ │ Compress data (Snappy, Gzip): │
101
+ │ → Reduce scan size → reduce cost │
102
+ └────────────────────────────────────────────────┘
103
+ </code></pre>
104
+
105
+ <h2 id="quicksight"><strong>5. Amazon QuickSight</strong></h2>
106
+
107
+ <p>QuickSight là <strong>BI service</strong>, không phải ML tool. Key feature: <strong>SPICE</strong> (in-memory engine) cho fast dashboards.</p>
108
+
109
+ <table>
110
+ <thead><tr><th>Feature</th><th>Description</th></tr></thead>
111
+ <tbody>
112
+ <tr><td><strong>SPICE</strong></td><td>Super-fast Parallel In-memory Calculation Engine — cached dataset</td></tr>
113
+ <tr><td><strong>ML Insights</strong></td><td>Built-in anomaly detection, forecasting trên dashboards</td></tr>
114
+ <tr><td><strong>Q (NLQ)</strong></td><td>Natural language queries — "show me sales by region last month"</td></tr>
115
+ </tbody>
116
+ </table>
117
+
118
+ <h2 id="cheat-sheet"><strong>6. Cheat Sheet — Analysis Tools</strong></h2>
119
+
120
+ <table>
121
+ <thead><tr><th>Scenario</th><th>Tool</th></tr></thead>
122
+ <tbody>
123
+ <tr><td>Interactive Python EDA on large data</td><td>SageMaker Studio Notebooks</td></tr>
124
+ <tr><td>Visual no-code ML data prep</td><td>SageMaker Data Wrangler</td></tr>
125
+ <tr><td>SQL on S3 data (serverless)</td><td>Amazon Athena</td></tr>
126
+ <tr><td>Business dashboards và reporting</td><td>Amazon QuickSight</td></tr>
127
+ <tr><td>Large data warehouse SQL</td><td>Amazon Redshift</td></tr>
128
+ <tr><td>No-code data profiling recipes</td><td>AWS Glue DataBrew</td></tr>
129
+ </tbody>
130
+ </table>
131
+
132
+ <h2 id="practice"><strong>7. Practice Questions</strong></h2>
133
+
134
+ <p><strong>Q1:</strong> A data scientist standardized features using the mean and standard deviation of the ENTIRE dataset before splitting into train/test sets. What problem does this cause?</p>
135
+ <ul>
136
+ <li>A) Model underfitting</li>
137
+ <li>B) Slow training convergence</li>
138
+ <li>C) Data leakage from test set statistics into training ✓</li>
139
+ <li>D) Class imbalance</li>
140
+ </ul>
141
+ <p><em>Explanation: Fitting a scaler on the entire dataset causes data leakage — the test set statistics (mean, std) influence the training data transformation. Always fit transformers on training data only, then apply the fitted transformer to both train and test sets.</em></p>
142
+
143
+ <p><strong>Q2:</strong> A business analyst needs to create executive dashboards from S3 data with fast interactive visualizations. Which AWS service is BEST suited?</p>
144
+ <ul>
145
+ <li>A) Amazon SageMaker Studio</li>
146
+ <li>B) Amazon Athena</li>
147
+ <li>C) Amazon QuickSight ✓</li>
148
+ <li>D) AWS Glue DataBrew</li>
149
+ </ul>
150
+ <p><em>Explanation: Amazon QuickSight is the AWS BI service designed for business dashboards and visualizations with SPICE in-memory engine for fast interactive queries. SageMaker Studio is for ML development, Athena is SQL querying, DataBrew is data preparation.</em></p>
151
+
152
+ <p><strong>Q3:</strong> A model trained on customer churn data has 99% training accuracy but performs poorly on production data. Investigation shows "days_since_last_call" is more predictive than expected. What is the MOST likely cause?</p>
153
+ <ul>
154
+ <li>A) Overfitting due to too many features</li>
155
+ <li>B) Underfitting due to low model complexity</li>
156
+ <li>C) Data leakage — the feature is derived from post-churn activity ✓</li>
157
+ <li>D) Class imbalance</li>
158
+ </ul>
159
+ <p><em>Explanation: This is classic target leakage — "days_since_last_call" may reflect churn behavior after the fact (customers call to cancel). This future information isn't available in production, causing the model to fail.</em></p>
@@ -0,0 +1,186 @@
1
+ ---
2
+ id: 8d704042-9cc5-478e-b198-d80ea70c22c5
3
+ title: 'Bài 4: SageMaker Built-in Algorithms'
4
+ slug: bai-4-sagemaker-built-in-algorithms
5
+ description: >-
6
+ XGBoost, Linear Learner, Random Cut Forest, K-Means, KNN.
7
+ BlazingText, Seq2Seq, DeepAR, Object Detection, Semantic Segmentation.
8
+ Khi nào dùng algorithm nào — decision table chi tiết.
9
+ duration_minutes: 90
10
+ is_free: true
11
+ video_url: null
12
+ sort_order: 4
13
+ section_title: "Phần 2: Modeling (36%)"
14
+ course:
15
+ id: 019c9619-lt02-7002-c002-lt0200000002
16
+ title: 'Luyện thi AWS Certified Machine Learning - Specialty'
17
+ slug: luyen-thi-aws-ml-specialty
18
+ ---
19
+
20
+ <div style="text-align: center; margin: 2rem 0;">
21
+ <img src="/storage/uploads/2026/04/aws-mls-bai4-sagemaker-algorithms.png" alt="SageMaker Built-in Algorithms" style="max-width: 800px; width: 100%; border-radius: 12px;" />
22
+ <p><em>SageMaker Built-in Algorithms: từ XGBoost, Linear Learner đến DeepAR và Image Classification</em></p>
23
+ </div>
24
+
25
+ <h2 id="overview"><strong>1. SageMaker Built-in Algorithms Overview</strong></h2>
26
+
27
+ <p>SageMaker cung cấp 18+ <strong>built-in algorithms</strong> được optimize để chạy distributed trên AWS infrastructure. Đây là topic <strong>cực kỳ quan trọng</strong> trong MLS-C01 — thường chiếm 8-12 câu.</p>
28
+
29
+ <blockquote>
30
+ <p><strong>Exam tip:</strong> Học thuộc bảng "Problem Type → Algorithm". Đề thi luôn cho scenario và hỏi algorithm phù hợp. Key patterns: time series → DeepAR; anomaly → Random Cut Forest; NLP classification → BlazingText; tabular → XGBoost.</p>
31
+ </blockquote>
32
+
33
+ <h2 id="supervised-table"><strong>2. Supervised Learning Algorithms</strong></h2>
34
+
35
+ <table>
36
+ <thead><tr><th>Algorithm</th><th>Problem Type</th><th>Input</th><th>Key Trait</th></tr></thead>
37
+ <tbody>
38
+ <tr><td><strong>XGBoost</strong></td><td>Classification, Regression</td><td>Tabular (CSV/LibSVM)</td><td>Top performer cho tabular data, gradient boosting</td></tr>
39
+ <tr><td><strong>Linear Learner</strong></td><td>Binary/Multiclass classification, Regression</td><td>RecordIO, CSV</td><td>Fast, scalable, regularization built-in</td></tr>
40
+ <tr><td><strong>Factorization Machines</strong></td><td>Binary classification, Regression</td><td>RecordIO-protobuf (sparse)</td><td>Sparse data, recommendation systems, CTR prediction</td></tr>
41
+ <tr><td><strong>KNN (k-Nearest Neighbors)</strong></td><td>Classification, Regression</td><td>RecordIO-protobuf</td><td>Instance-based, no training, lazy learner</td></tr>
42
+ <tr><td><strong>DeepAR</strong></td><td>Time series forecasting</td><td>JSON Lines</td><td>Multiple related time series, probabilistic forecasts</td></tr>
43
+ <tr><td><strong>Object2Vec</strong></td><td>Embeddings</td><td>Paired sequences</td><td>Learn embeddings cho words, products, users</td></tr>
44
+ </tbody>
45
+ </table>
46
+
47
+ <h2 id="nlp-algorithms"><strong>3. NLP Algorithms</strong></h2>
48
+
49
+ <table>
50
+ <thead><tr><th>Algorithm</th><th>Output</th><th>Use Case</th></tr></thead>
51
+ <tbody>
52
+ <tr><td><strong>BlazingText</strong></td><td>Word vectors hoặc text classification</td><td>Sentiment analysis, spam detection, entity classification</td></tr>
53
+ <tr><td><strong>Seq2Seq</strong></td><td>Sequence → Sequence</td><td>Machine translation, summarization, Q&amp;A</td></tr>
54
+ <tr><td><strong>LDA (Latent Dirichlet Allocation)</strong></td><td>Topics per document</td><td>Topic modeling, document categorization</td></tr>
55
+ <tr><td><strong>NTM (Neural Topic Model)</strong></td><td>Latent representations</td><td>Topic modeling với neural networks</td></tr>
56
+ </tbody>
57
+ </table>
58
+
59
+ <blockquote>
60
+ <p><strong>Exam tip:</strong> <strong>BlazingText</strong> có 2 modes: (1) <code>Word2Vec</code> mode — unsupervised, generates word embeddings; (2) <code>Text Classification</code> mode — supervised, like FastText. Phân biệt rõ khi đọc câu hỏi.</p>
61
+ </blockquote>
62
+
63
+ <h2 id="unsupervised-algorithms"><strong>4. Unsupervised Learning Algorithms</strong></h2>
64
+
65
+ <table>
66
+ <thead><tr><th>Algorithm</th><th>Problem Type</th><th>Use Case</th></tr></thead>
67
+ <tbody>
68
+ <tr><td><strong>K-Means</strong></td><td>Clustering</td><td>Customer segmentation, document grouping</td></tr>
69
+ <tr><td><strong>PCA (Principal Component Analysis)</strong></td><td>Dimensionality reduction</td><td>High-dimensional data, feature compression</td></tr>
70
+ <tr><td><strong>Random Cut Forest (RCF)</strong></td><td>Anomaly detection</td><td>Fraud detection, IoT anomaly, time series anomaly</td></tr>
71
+ <tr><td><strong>IP Insights</strong></td><td>Anomaly detection</td><td>Detect unusual IP-entity relationships, security</td></tr>
72
+ </tbody>
73
+ </table>
74
+
75
+ <h2 id="computer-vision"><strong>5. Computer Vision Algorithms</strong></h2>
76
+
77
+ <table>
78
+ <thead><tr><th>Algorithm</th><th>Task</th><th>Output</th></tr></thead>
79
+ <tbody>
80
+ <tr><td><strong>Image Classification</strong></td><td>Multi-class classification</td><td>Class label + confidence</td></tr>
81
+ <tr><td><strong>Object Detection</strong></td><td>Locate + classify objects</td><td>Bounding boxes + labels</td></tr>
82
+ <tr><td><strong>Semantic Segmentation</strong></td><td>Pixel-level classification</td><td>Segmentation mask</td></tr>
83
+ </tbody>
84
+ </table>
85
+
86
+ <h2 id="algorithm-decision"><strong>6. Algorithm Selection Decision Tree</strong></h2>
87
+
88
+ <pre><code class="language-text">What is the problem type?
89
+
90
+ ├── Tabular data, classification/regression?
91
+ │ └── XGBoost (best general choice)
92
+
93
+ ├── Sparse features, recommendation, ad CTR?
94
+ │ └── Factorization Machines
95
+
96
+ ├── Time series forecasting (multiple related series)?
97
+ │ └── DeepAR
98
+
99
+ ├── Anomaly detection on time series / IoT?
100
+ │ └── Random Cut Forest (RCF)
101
+
102
+ ├── Text classification / sentiment?
103
+ │ └── BlazingText (supervised mode)
104
+
105
+ ├── Sequence-to-sequence (translation / summarization)?
106
+ │ └── Seq2Seq
107
+
108
+ ├── Topic modeling?
109
+ │ └── LDA or NTM
110
+
111
+ ├── Clustering?
112
+ │ └── K-Means
113
+
114
+ ├── Dimensionality reduction?
115
+ │ └── PCA
116
+
117
+ └── Image tasks?
118
+ ├── Classification only → Image Classification
119
+ ├── Locate objects → Object Detection
120
+ └── Pixel mask → Semantic Segmentation
121
+ </code></pre>
122
+
123
+ <h2 id="training-modes"><strong>7. Training Input Modes</strong></h2>
124
+
125
+ <table>
126
+ <thead><tr><th>Mode</th><th>How It Works</th><th>Best For</th></tr></thead>
127
+ <tbody>
128
+ <tr><td><strong>File Mode</strong></td><td>Downloads entire dataset to training instance before starting</td><td>Small to medium datasets</td></tr>
129
+ <tr><td><strong>Pipe Mode</strong></td><td>Streams data directly from S3 during training</td><td>Very large datasets — no disk bottleneck</td></tr>
130
+ <tr><td><strong>FastFile Mode</strong></td><td>Access S3 as if local file system (via FUSE)</td><td>Random access patterns</td></tr>
131
+ </tbody>
132
+ </table>
133
+
134
+ <blockquote>
135
+ <p><strong>Exam tip:</strong> Khi đề hỏi "reduce training time for large dataset", đáp án thường là chuyển sang <strong>Pipe Mode</strong> với <strong>RecordIO format</strong>. Pipe Mode không download toàn bộ dataset — stream trực tiếp từ S3.</p>
136
+ </blockquote>
137
+
138
+ <h2 id="cheat-sheet"><strong>8. Cheat Sheet — Quick Reference</strong></h2>
139
+
140
+ <table>
141
+ <thead><tr><th>Keyword in Question</th><th>Algorithm</th></tr></thead>
142
+ <tbody>
143
+ <tr><td>"tabular data", "structured data"</td><td>XGBoost</td></tr>
144
+ <tr><td>"time series", "forecast"</td><td>DeepAR</td></tr>
145
+ <tr><td>"anomaly detection"</td><td>Random Cut Forest</td></tr>
146
+ <tr><td>"recommendation", "sparse features"</td><td>Factorization Machines</td></tr>
147
+ <tr><td>"text classification", "sentiment"</td><td>BlazingText (supervised)</td></tr>
148
+ <tr><td>"word embeddings"</td><td>BlazingText (Word2Vec mode)</td></tr>
149
+ <tr><td>"translation", "summarization"</td><td>Seq2Seq</td></tr>
150
+ <tr><td>"topic modeling"</td><td>LDA or NTM</td></tr>
151
+ <tr><td>"clustering", "segmentation"</td><td>K-Means</td></tr>
152
+ <tr><td>"dimensionality reduction"</td><td>PCA</td></tr>
153
+ <tr><td>"bounding boxes", "object detection"</td><td>Object Detection</td></tr>
154
+ <tr><td>"pixel-level", "segmentation mask"</td><td>Semantic Segmentation</td></tr>
155
+ <tr><td>"IP address anomaly", "fraud login"</td><td>IP Insights</td></tr>
156
+ </tbody>
157
+ </table>
158
+
159
+ <h2 id="practice"><strong>9. Practice Questions</strong></h2>
160
+
161
+ <p><strong>Q1:</strong> A retail company wants to forecast product demand for the next 30 days across 5,000 product categories. Which SageMaker algorithm is BEST suited?</p>
162
+ <ul>
163
+ <li>A) K-Means</li>
164
+ <li>B) Linear Learner</li>
165
+ <li>C) DeepAR ✓</li>
166
+ <li>D) Seq2Seq</li>
167
+ </ul>
168
+ <p><em>Explanation: DeepAR is specifically designed for time series forecasting across multiple related time series. It learns global patterns from all 5,000 series simultaneously, providing probabilistic forecasts. This is exactly the use case it's optimized for.</em></p>
169
+
170
+ <p><strong>Q2:</strong> An IoT system monitors server CPU usage. The team wants to detect unusual spikes automatically. Which SageMaker built-in algorithm should be used?</p>
171
+ <ul>
172
+ <li>A) XGBoost</li>
173
+ <li>B) Random Cut Forest ✓</li>
174
+ <li>C) BlazingText</li>
175
+ <li>D) PCA</li>
176
+ </ul>
177
+ <p><em>Explanation: Random Cut Forest (RCF) is SageMaker's built-in anomaly detection algorithm. It assigns an anomaly score to each data point and works well for time series anomaly detection, such as CPU usage spikes.</em></p>
178
+
179
+ <p><strong>Q3:</strong> A data scientist is training a model on a 500 GB dataset. Training is very slow because downloading data to the training instance takes too long. Which change will MOST improve performance?</p>
180
+ <ul>
181
+ <li>A) Switch from CSV to JSON format</li>
182
+ <li>B) Increase the training instance size</li>
183
+ <li>C) Switch to Pipe Mode with RecordIO-protobuf format ✓</li>
184
+ <li>D) Add more training epochs</li>
185
+ </ul>
186
+ <p><em>Explanation: Pipe Mode streams data directly from S3 during training without downloading it first, eliminating the I/O bottleneck for large datasets. Combined with RecordIO-protobuf format, it dramatically reduces startup time.</em></p>
@@ -0,0 +1,159 @@
1
+ ---
2
+ id: 8a7a5367-e4a4-4796-8aab-68326c1dc574
3
+ title: 'Bài 5: Training & Hyperparameter Tuning'
4
+ slug: bai-5-training-hyperparameter-tuning
5
+ description: >-
6
+ SageMaker Training Jobs: instance types, Pipe Mode vs File Mode.
7
+ Distributed training: data parallelism vs model parallelism.
8
+ Automatic Model Tuning (HPO): Bayesian vs Random vs Grid search.
9
+ Spot Instance Training để giảm chi phí.
10
+ duration_minutes: 60
11
+ is_free: true
12
+ video_url: null
13
+ sort_order: 5
14
+ section_title: "Phần 2: Modeling (36%)"
15
+ course:
16
+ id: 019c9619-lt02-7002-c002-lt0200000002
17
+ title: 'Luyện thi AWS Certified Machine Learning - Specialty'
18
+ slug: luyen-thi-aws-ml-specialty
19
+ ---
20
+
21
+ <div style="text-align: center; margin: 2rem 0;">
22
+ <img src="/storage/uploads/2026/04/aws-mls-bai5-training-hpo.png" alt="SageMaker Training & Hyperparameter Tuning" style="max-width: 800px; width: 100%; border-radius: 12px;" />
23
+ <p><em>SageMaker Training Jobs & Hyperparameter Tuning: distributed training, Spot Instances, và HPO strategies</em></p>
24
+ </div>
25
+
26
+ <h2 id="training-jobs"><strong>1. SageMaker Training Jobs</strong></h2>
27
+
28
+ <p><strong>SageMaker Training Jobs</strong> chạy ML training code trên managed compute infrastructure. Training xảy ra trên ephemeral instances — chỉ tính phí khi chạy.</p>
29
+
30
+ <pre><code class="language-text">Training Job Lifecycle:
31
+
32
+ Submit Job ──→ Provision Instances ──→ Download Data
33
+
34
+ Run Training Code
35
+
36
+ Save Model to S3
37
+
38
+ Terminate Instances
39
+ </code></pre>
40
+
41
+ <h2 id="instance-types"><strong>2. Instance Types cho Training</strong></h2>
42
+
43
+ <table>
44
+ <thead><tr><th>Instance Family</th><th>Hardware</th><th>Best For</th></tr></thead>
45
+ <tbody>
46
+ <tr><td><strong>ml.c5</strong></td><td>CPU optimized</td><td>Tabular ML, XGBoost, sklearn</td></tr>
47
+ <tr><td><strong>ml.m5</strong></td><td>General purpose CPU</td><td>Light training, data processing</td></tr>
48
+ <tr><td><strong>ml.p3</strong></td><td>V100 GPU</td><td>Deep learning training</td></tr>
49
+ <tr><td><strong>ml.p4d</strong></td><td>A100 GPU (8x)</td><td>Large-scale DL, distributed training</td></tr>
50
+ <tr><td><strong>ml.g4dn</strong></td><td>T4 GPU (cost-effective)</td><td>Small-medium DL models</td></tr>
51
+ <tr><td><strong>ml.trn1</strong></td><td>AWS Trainium</td><td>LLM training, cost optimization</td></tr>
52
+ </tbody>
53
+ </table>
54
+
55
+ <h2 id="distributed-training"><strong>3. Distributed Training</strong></h2>
56
+
57
+ <p>Khi model hoặc dataset quá lớn cho một instance, cần <strong>distributed training</strong> trên nhiều instances.</p>
58
+
59
+ <table>
60
+ <thead><tr><th>Strategy</th><th>How It Works</th><th>When to Use</th></tr></thead>
61
+ <tbody>
62
+ <tr><td><strong>Data Parallelism</strong></td><td>Mỗi instance có copy của model, train trên subset của data, sync gradients</td><td>Dataset quá lớn, model vừa vặn trong 1 GPU</td></tr>
63
+ <tr><td><strong>Model Parallelism</strong></td><td>Model split across instances, mỗi instance chứa 1 phần</td><td>Model quá lớn cho 1 GPU (LLMs)</td></tr>
64
+ </tbody>
65
+ </table>
66
+
67
+ <pre><code class="language-text">Data Parallelism:
68
+
69
+ Instance 1 [Full Model] ──→ Train on data shard A ──→ ↓
70
+ Instance 2 [Full Model] ──→ Train on data shard B ──→ ↓ AllReduce
71
+ Instance 3 [Full Model] ──→ Train on data shard C ──→ ↓ (sync gradients)
72
+
73
+ Updated Model Weights
74
+
75
+ Model Parallelism:
76
+
77
+ Instance 1 [Layers 1-4] ──→ forward pass ──→
78
+ Instance 2 [Layers 5-8] ──→ forward pass ──→
79
+ Instance 3 [Layers 9-12] ──→ forward pass ──→ output
80
+ </code></pre>
81
+
82
+ <blockquote>
83
+ <p><strong>Exam tip:</strong> SageMaker cung cấp <strong>SageMaker Distributed</strong> library với 2 modules: (1) <code>smdistributed.dataparallel</code> — optimized AllReduce; (2) <code>smdistributed.modelparallel</code> — auto pipeline parallelism. Khi đề hỏi "large model training" → model parallelism.</p>
84
+ </blockquote>
85
+
86
+ <h2 id="hpo"><strong>4. Automatic Model Tuning (HPO)</strong></h2>
87
+
88
+ <p><strong>Hyperparameter Optimization (HPO)</strong> tự động tìm hyperparameters tốt nhất bằng cách chạy nhiều training jobs với configs khác nhau.</p>
89
+
90
+ <table>
91
+ <thead><tr><th>Strategy</th><th>How It Works</th><th>Tradeoff</th></tr></thead>
92
+ <tbody>
93
+ <tr><td><strong>Random Search</strong></td><td>Randomly sample hyperparameters từ range</td><td>Fast, good baseline</td></tr>
94
+ <tr><td><strong>Grid Search</strong></td><td>Try all combinations</td><td>Exhaustive, expensive, bad for large spaces</td></tr>
95
+ <tr><td><strong>Bayesian Optimization</strong></td><td>Probabilistic model của outcome, suggest best next config</td><td>Efficient, learns from previous trials — SageMaker default</td></tr>
96
+ <tr><td><strong>Hyperband</strong></td><td>Early-stop poorly performing trials</td><td>Resource-efficient, fast</td></tr>
97
+ </tbody>
98
+ </table>
99
+
100
+ <blockquote>
101
+ <p><strong>Exam tip:</strong> SageMaker AMT (Automatic Model Tuning) dùng <strong>Bayesian Optimization</strong> by default. Nó XEM KẾT QUẢ từ các jobs trước để suggest next hyperparameter set — intelligent search, không phải brute force.</p>
102
+ </blockquote>
103
+
104
+ <h2 id="spot-training"><strong>5. Spot Instance Training</strong></h2>
105
+
106
+ <p>SageMaker hỗ trợ dùng <strong>EC2 Spot Instances</strong> cho training jobs, tiết kiệm đến <strong>90% chi phí</strong> so với On-Demand.</p>
107
+
108
+ <table>
109
+ <thead><tr><th>Feature</th><th>Detail</th></tr></thead>
110
+ <tbody>
111
+ <tr><td><strong>MaxWaitTimeInSeconds</strong></td><td>Maximum thời gian đợi spot capacity</td></tr>
112
+ <tr><td><strong>Checkpointing</strong></td><td>Lưu model to S3 periodically — resume sau khi bị interrupt</td></tr>
113
+ <tr><td><strong>use_spot_instances=True</strong></td><td>Parameter trong SageMaker Estimator</td></tr>
114
+ </tbody>
115
+ </table>
116
+
117
+ <blockquote>
118
+ <p><strong>Exam tip:</strong> Khi đề hỏi "reduce training costs", đáp án thường là <strong>Spot Instances với checkpointing</strong>. Checkpointing quan trọng để tránh mất progress khi spot instance bị terminate.</p>
119
+ </blockquote>
120
+
121
+ <h2 id="bias-variance"><strong>6. Bias-Variance Tradeoff</strong></h2>
122
+
123
+ <table>
124
+ <thead><tr><th>Issue</th><th>Symptom</th><th>Cause</th><th>Solution</th></tr></thead>
125
+ <tbody>
126
+ <tr><td><strong>High Bias (Underfitting)</strong></td><td>High train error, high test error</td><td>Model quá đơn giản</td><td>Tăng model complexity, thêm features, giảm regularization</td></tr>
127
+ <tr><td><strong>High Variance (Overfitting)</strong></td><td>Low train error, high test error</td><td>Model quá phức tạp</td><td>Thêm data, dropout, regularization, feature selection</td></tr>
128
+ <tr><td><strong>Balanced</strong></td><td>Low train error, low test error (gần nhau)</td><td>Good fit</td><td>Deploy model</td></tr>
129
+ </tbody>
130
+ </table>
131
+
132
+ <h2 id="practice"><strong>7. Practice Questions</strong></h2>
133
+
134
+ <p><strong>Q1:</strong> A company is training a large deep learning model that doesn't fit on a single GPU instance. Which SageMaker distributed training strategy should they use?</p>
135
+ <ul>
136
+ <li>A) Data parallelism</li>
137
+ <li>B) Model parallelism ✓</li>
138
+ <li>C) Pipeline parallelism only</li>
139
+ <li>D) Increase batch size</li>
140
+ </ul>
141
+ <p><em>Explanation: Model parallelism splits the model itself across multiple GPU instances, allowing training of models too large to fit in a single GPU's memory. Data parallelism keeps a full model copy on each instance, which doesn't help when the model itself is too large.</em></p>
142
+
143
+ <p><strong>Q2:</strong> A team wants to minimize the cost of running 500 hyperparameter tuning jobs. Training can tolerate interruptions. What is the MOST cost-effective approach?</p>
144
+ <ul>
145
+ <li>A) Use larger instances to run jobs faster</li>
146
+ <li>B) Use Spot Instances with checkpointing enabled ✓</li>
147
+ <li>C) Use Grid Search instead of Bayesian Optimization</li>
148
+ <li>D) Reduce the number of epochs</li>
149
+ </ul>
150
+ <p><em>Explanation: Spot Instances can save up to 90% compared to On-Demand pricing. With checkpointing enabled, interrupted jobs save their state to S3 and can resume, making Spot Instances practical for long HPO jobs.</em></p>
151
+
152
+ <p><strong>Q3:</strong> A model achieves 95% accuracy on training data but only 62% on the test set. What problem does this indicate?</p>
153
+ <ul>
154
+ <li>A) Underfitting / High bias</li>
155
+ <li>B) Overfitting / High variance ✓</li>
156
+ <li>C) Data leakage</li>
157
+ <li>D) Class imbalance</li>
158
+ </ul>
159
+ <p><em>Explanation: The large gap between training accuracy (95%) and test accuracy (62%) is a classic sign of overfitting (high variance). The model memorized the training data but fails to generalize. Solutions: more data, regularization (L1/L2, dropout), reduce model complexity.</em></p>