# Python - Machine Learning Class in NCU ###### tags: `Python` `ML` * WiFi Account ``` WIFI:ERP01 PW: ncuerp01 ``` --- **李明昌 博士** 網站: [https://rwepa.blogspot.com/](https://rwepa.blogspot.com/) E-mail: alan9956@gmail.com 課程 Example Code: (有時效性) https://pse.is/4h2k4b --- * 工具: Anaconda with spyder https://www.spyder-ide.org/ * 相關網站: 1. Anaconda https://www.anaconda.com/distribution/ 2. scikit-learn https://scikit-learn.org/stable/index.html --- **Day 1 review:** 各位學員好, 謝謝各位的參與, 參考以下今日課程回顧: 1. 資料分析10字箴言: > 群組,時間,建立評估變數 2. 善用 pandas 模組: > 參考線上PDF-第5章 https://github.com/rwepa/DataDemo/blob/master/Python_Programming_Lee.pdf > > 熟悉 OnlineRetail.csv 資料匯入與操作 > > 讀取 CSV 檔案 : pd.read_csv > 讀取 Excel 檔案 : pd.read_excel > 資料物件 : type > 資料描述 : df.describe > 資料訊息 : df.info > 字串轉換為日期時間 : pd.to_datetime > 欄位資料套用到函數 : df['欄位名稱'].map() > 群組 : groupby > 欄位名稱更名 : rename > 排序 : sort_values > 不重複值 : unique > 合位2個資料框 : merge 3. 關聯規則: > mlxtend 模組 4. 載入主成分分析模組: > from sklearn.decomposition import PCA 5. 資料標準化(x-μ)/σ: > from sklearn.preprocessing import StandardScaler --- ![](https://i.imgur.com/ONOnvV8.png) 取自: https://scikit-learn.org/stable/tutorial/machine_learning_map/index.html --- ``` matplotlib 3.6.0 mlxtend 0.21.0 numpy 1.23.3 pandas 1.5.0 plotly 5.10.0 scikit-learn 1.1.2 ``` --- ![](https://i.imgur.com/q9XymKL.png) --- Tensorflow library import error in Python ``` 2022-10-01 12:05:11.623351: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-10-01 12:05:11.792881: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2022-10-01 12:05:11.792929: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2022-10-01 12:05:11.828712: E tensorflow/stream_executor/cuda/cuda_blas.cc:2981] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2022-10-01 12:05:12.686645: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory 2022-10-01 12:05:12.686737: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory 2022-10-01 12:05:12.686751: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly. ``` ---