diff --git a/code/notebooks/stft.ipynb b/code/notebooks/stft.ipynb index 439fa21..c1873f1 100644 --- a/code/notebooks/stft.ipynb +++ b/code/notebooks/stft.ipynb @@ -443,6 +443,37 @@ "plt.pcolormesh(ready_data2a[0].transpose(), cmap='jet', vmax=0.03, vmin=0.0)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ready_data1b = []\n", + "for file in os.listdir('D:/thesis/data/converted/raw_B/sensor1'):\n", + " ready_data1b.append(pd.read_csv(os.path.join('D:/thesis/data/converted/raw_B/sensor1', file), skiprows=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# dpi\n", + "plt.figure(dpi=300) # Set figure size and DPI\n", + "plt.pcolormesh(ready_data1b[0].iloc[:22,:].transpose(), cmap='jet', vmax=0.03, vmin=0.0)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "len(ready_data1b[0])" + ] + }, { "cell_type": "code", "execution_count": null, @@ -660,8 +691,8 @@ "metadata": {}, "outputs": [], "source": [ - "X1a.iloc[-1,:]\n", - "# y[2565]" + "# X1a.iloc[-1,:]\n", + "y[2564]" ] }, { @@ -717,6 +748,7 @@ "from sklearn.preprocessing import StandardScaler\n", "from sklearn.svm import SVC\n", "from sklearn.decomposition import PCA\n", + "from xgboost import XGBClassifier\n", "# Define models for sensor1\n", "models_sensor1 = {\n", " # \"Random Forest\": RandomForestClassifier(),\n", @@ -724,14 +756,14 @@ " # \"Decision Tree\": DecisionTreeClassifier(),\n", " # \"KNN\": KNeighborsClassifier(),\n", " # \"LDA\": LinearDiscriminantAnalysis(),\n", - " \"SVM\": SVC(),\n", - " \"SVM with StandardScaler and PCA\": make_pipeline(\n", - " StandardScaler(),\n", - " PCA(n_components=10),\n", - " SVC(kernel='rbf')\n", - " ),\n", + " # \"SVM\": SVC(),\n", + " # \"SVM with StandardScaler and PCA\": make_pipeline(\n", + " # StandardScaler(),\n", + " # PCA(n_components=10),\n", + " # SVC(kernel='rbf')\n", + " # ),\n", "\n", - " # \"XGBoost\": XGBClassifier()\n", + " \"XGBoost\": XGBClassifier()\n", "}\n", "\n", "results_sensor1 = []\n",