REF : NTU ccCLUB Python 入門 (1)安裝pip python -m pip install --upgrade pip (2) 用pip 裝numpy 陣列模組 C:\Users\USER\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe install numpy Successfully installed numpy-1.17.3 (3)用pip裝matplotlib C:\Users\USER\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe install matplotlib : Installing collected packages: six, cycler, kiwisolver, python-dateutil, pyparsing, matplotlib (4)用pip裝sklearn C:\Users\USER\AppData\Local\Programs\Python\Python37\Scripts\pip3.7.exe install sklearn : Successfully installed joblib-0.14.0 scikit-learn-0.21.3 scipy-1.3.1 sklearn-0.0 (5-0)自https://scikit-learn.org下載k近鄰分類模擬程式 (5-1)將上方程式碼拷入記事本並存為d:\knbc.py (6-1)執行 python knbc.py結果如下:
|