[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
> 🎥 點擊上圖觀看短視頻概述類別特徵的使用。
> 🎥 點擊上圖觀看簡短影片,了解如何使用類別特徵。
以下展示價格與品種的平均關係:
這裡展示了平均價格與品種的關係:
<imgalt="Average price by variety"src="../../../../translated_images/zh-HK/price-by-variety.744a2f9925d9bcb4.webp"width="50%"/>
- 授課組別完成後,拜訪 [討論區](https://github.com/microsoft/ML-For-Beginners/discussions),藉由填寫對應的 PAT 評量表「大聲學習」。PAT 是進度評量工具,是你填寫來促進學習的評量表,你也可以對其他人的 PAT 進行回應,大家共同進步。
- 完成一組課程後,前往 [討論區](https://github.com/microsoft/ML-For-Beginners/discussions),透過填寫合適的 PAT 評分表「大聲學習」。'PAT' 是進度評估工具,透過表格幫助你學習。你也可以回應他人 PAT,一起進步。
| 04 | 機器學習技術 | [Introduction](1-Introduction/README.md) | 機器學習研究者用哪些技術來建構機器學習模型? | [課程](1-Introduction/4-techniques-of-ML/README.md) | Chris and Jen |
[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
> 🎥 點擊上圖觀看使用類別特徵的短片介紹。
> 🎥 點擊上方圖片觀看使用類別特徵的簡短影片介紹。
這裡展示了平均價格與品種的關係:
這裡展示了平均價格如何依品種變化:
<imgalt="Average price by variety"src="../../../../translated_images/zh-MO/price-by-variety.744a2f9925d9bcb4.webp"width="50%"/>
- 完成一組課程後,造訪 [討論區](https://github.com/microsoft/ML-For-Beginners/discussions) 並透過填寫「PAT」評分表格來「大聲學習」──PAT 是一種進度評估工具,填寫後能加深學習。你也可以對其它人的 PAT 作出回應,大家一起學習。
- 完成一組課程後,請到 [討論區](https://github.com/microsoft/ML-For-Beginners/discussions),透過填寫對應的 PAT 評分標準進行「大聲學習」。PAT(Progress Assessment Tool)是您填寫的進度評估工具。也可以對其他人的 PAT 作出回應,大家一起學習。
| 04 | 機器學習技術 | [Introduction](1-Introduction/README.md) | 機器學習研究人員使用了哪些技術來建立機器學習模型? | [Lesson](1-Introduction/4-techniques-of-ML/README.md) | Chris and Jen |
請在此處找到包含連結的課程綱要 pdf [here](https://microsoft.github.io/ML-For-Beginners/pdf/readme.pdf)。
## 🎒 其他課程
我們團隊也有其他課程!請查看:
我們團隊還製作其他課程!歡迎瀏覽:
<!-- CO-OP TRANSLATOR OTHER COURSES START -->
### LangChain
@ -183,54 +183,65 @@
### Azure / Edge / MCP / Agents
[](https://github.com/microsoft/AZD-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/edgeai-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/ai-agents-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/mcp-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/ai-agents-for-beginners?WT.mc_id=academic-105485-koreyst)
[-9333EA?style=for-the-badge&labelColor=E5E7EB&color=9333EA)](https://github.com/microsoft/Generative-AI-for-beginners-dotnet?WT.mc_id=academic-105485-koreyst)
[-C084FC?style=for-the-badge&labelColor=E5E7EB&color=C084FC)](https://github.com/microsoft/generative-ai-for-beginners-java?WT.mc_id=academic-105485-koreyst)
[-E879F9?style=for-the-badge&labelColor=E5E7EB&color=E879F9)](https://github.com/microsoft/generative-ai-with-javascript?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/generative-ai-for-beginners?WT.mc_id=academic-105485-koreyst)
[-9333EA?style=for-the-badge&labelColor=E5E7EB&color=9333EA)](https://github.com/microsoft/Generative-AI-for-beginners-dotnet?WT.mc_id=academic-105485-koreyst)
[-C084FC?style=for-the-badge&labelColor=E5E7EB&color=C084FC)](https://github.com/microsoft/generative-ai-for-beginners-java?WT.mc_id=academic-105485-koreyst)
[-E879F9?style=for-the-badge&labelColor=E5E7EB&color=E879F9)](https://github.com/microsoft/generative-ai-with-javascript?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/ml-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/datascience-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/ai-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/Security-101?WT.mc_id=academic-96948-sayoung)
[](https://aka.ms/webdev-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/iot-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/xr-development-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/GitHubCopilotAI?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/mastering-github-copilot-for-dotnet-csharp-developers?WT.mc_id=academic-105485-koreyst)
[](https://youtu.be/CRxFT8oTDMg "ML for beginners - Understanding Linear Regression")
[](https://youtu.be/uoRq-lW2eQo "ML for beginners - Looking for Correlation: The Key to Linear Regression")
[](https://youtu.be/e4c_UP2fSjg "ML for beginners - Linear and Polynomial Regression using Scikit-learn")
> 🎥 點擊上圖觀看線性與多項式迴歸的短片介紹。
> 🎥 點擊上方圖片看簡單線性及多項式迴歸的短影片介紹。
我們將使用 **Scikit-learn** 框架來訓練線性迴歸模型。
我們將用 **Scikit-learn** 函式庫訓練線性迴歸模型。
```python
from sklearn.linear_model import LinearRegression
@ -183,48 +182,48 @@ from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
```
我們先將輸入值(特徵)與預期輸出(標籤)分離成不同的 numpy 陣列:
起初,我們將輸入值(特徵)與期望輸出(標籤)分別放入兩個 numpy 陣列:
```python
X = pie_pumpkins['DayOfYear'].to_numpy().reshape(-1,1)
y = pie_pumpkins['Price']
```
> 請注意,我們對輸入資料執行 `reshape`,讓線性迴歸套件能正確理解。線性迴歸期望 2D 陣列作為輸入,陣列的每一列代表一組輸入特徵向量。我們這裡只有一個輸入,因此需要 N×1 形狀的陣列,其中 N 為資料集大小。
> 注意我們對輸入資料做了 `reshape`,讓線性迴歸套件正確識別。它預期輸入為 2 維陣列,每列為一組特徵向量。此處只有一個輸入,故需求是 N×1 形狀,其中 N 是資料集大小。
接著,我們將數據分割為訓練集與測試集,以便在訓練後驗證模型:
接下來,我們要將資料分割成訓練集和測試集,以利驗證模型表現:
```python
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
[](https://youtu.be/DYGliioIAE0 "ML for beginners - Categorical Feature Predictions with Linear Regression")
> 🎥 點擊上方圖片,觀看使用類別特徵的簡短影片介紹。
> 🎥 點擊上方圖片,可觀看使用類別特徵的簡短說明影片。
這裡展示不同品種的平均價格差異:
這裡展示了平均價格與品種的關係:
<imgalt="Average price by variety"src="../../../../translated_images/zh-TW/price-by-variety.744a2f9925d9bcb4.webp"width="50%"/>
- 完成一組課程後,請造訪 [討論板](https://github.com/microsoft/ML-For-Beginners/discussions) ,透過填寫相應的 PAT 評分表進行「實況學習」。PAT(Progress Assessment Tool)是您填寫來促進學習的評分表。您也可對其他人的 PAT 做出反應,大家一起學習。
- 完成一組課程後,請訪問 [討論區](https://github.com/microsoft/ML-For-Beginners/discussions),並透過填寫相對應的 PAT 評分表「大聲學習(learn out loud)」。PAT 是「進度評估工具」,您可透過填寫它來促進自己的學習。您也可以對其他人的 PAT 表示回應,讓我們一起學習。
| 04 | 機器學習技術 | [Introduction](1-Introduction/README.md) | 機器學習研究人員用什麼技術來建構機器學習模型? | [課程](1-Introduction/4-techniques-of-ML/README.md) | Chris and Jen |
| 04 | 機器學習技術 | [Introduction](1-Introduction/README.md) | ML 研究人員用來建立 ML 模型的技術有哪些? | [Lesson](1-Introduction/4-techniques-of-ML/README.md) | Chris and Jen |
請至此處下載一份帶有連結的課程綱要 PDF [here](https://microsoft.github.io/ML-For-Beginners/pdf/readme.pdf)。
## 🎒 其他課程
我們團隊還製作了其他課程!快來看看:
我們團隊還製作其他課程!請查看:
<!-- CO-OP TRANSLATOR OTHER COURSES START -->
### LangChain
[](https://aka.ms/langchain4j-for-beginners)
[](https://aka.ms/langchainjs-for-beginners?WT.mc_id=m365-94501-dwahlin)
[](https://github.com/microsoft/langchain-for-beginners?WT.mc_id=m365-94501-dwahlin)
[](https://github.com/microsoft/AZD-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/edgeai-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/mcp-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/ai-agents-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/edgeai-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/ai-agents-for-beginners?WT.mc_id=academic-105485-koreyst)
---
### 生成式 AI 系列
[](https://github.com/microsoft/generative-ai-for-beginners?WT.mc_id=academic-105485-koreyst)
[-9333EA?style=for-the-badge&labelColor=E5E7EB&color=9333EA)](https://github.com/microsoft/Generative-AI-for-beginners-dotnet?WT.mc_id=academic-105485-koreyst)
[-C084FC?style=for-the-badge&labelColor=E5E7EB&color=C084FC)](https://github.com/microsoft/generative-ai-for-beginners-java?WT.mc_id=academic-105485-koreyst)
[-E879F9?style=for-the-badge&labelColor=E5E7EB&color=E879F9)](https://github.com/microsoft/generative-ai-with-javascript?WT.mc_id=academic-105485-koreyst)
[-9333EA?style=for-the-badge&labelColor=E5E7EB&color=9333EA)](https://github.com/microsoft/Generative-AI-for-beginners-dotnet?WT.mc_id=academic-105485-koreyst)
[-C084FC?style=for-the-badge&labelColor=E5E7EB&color=C084FC)](https://github.com/microsoft/generative-ai-for-beginners-java?WT.mc_id=academic-105485-koreyst)
[-E879F9?style=for-the-badge&labelColor=E5E7EB&color=E879F9)](https://github.com/microsoft/generative-ai-with-javascript?WT.mc_id=academic-105485-koreyst)
---
### 核心學習
[](https://aka.ms/ml-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/datascience-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/ai-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/Security-101?WT.mc_id=academic-96948-sayoung)
[](https://aka.ms/webdev-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/iot-beginners?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/xr-development-for-beginners?WT.mc_id=academic-105485-koreyst)
[](https://aka.ms/GitHubCopilotAI?WT.mc_id=academic-105485-koreyst)
[](https://github.com/microsoft/mastering-github-copilot-for-dotnet-csharp-developers?WT.mc_id=academic-105485-koreyst)