refactor(stft): comment out unused imports and update SVM model loading for consistency
This commit is contained in:
@@ -636,11 +636,11 @@
|
||||
"from sklearn.preprocessing import StandardScaler\n",
|
||||
"from sklearn.svm import SVC\n",
|
||||
"from sklearn.decomposition import PCA\n",
|
||||
"from xgboost import XGBClassifier\n",
|
||||
"from sklearn.ensemble import RandomForestClassifier, BaggingClassifier\n",
|
||||
"from sklearn.tree import DecisionTreeClassifier\n",
|
||||
"from sklearn.neighbors import KNeighborsClassifier\n",
|
||||
"from sklearn.discriminant_analysis import LinearDiscriminantAnalysis\n",
|
||||
"# from xgboost import XGBClassifier\n",
|
||||
"# from sklearn.ensemble import RandomForestClassifier, BaggingClassifier\n",
|
||||
"# from sklearn.tree import DecisionTreeClassifier\n",
|
||||
"# from sklearn.neighbors import KNeighborsClassifier\n",
|
||||
"# from sklearn.discriminant_analysis import LinearDiscriminantAnalysis\n",
|
||||
"from sklearn.neural_network import MLPClassifier\n",
|
||||
"\n"
|
||||
]
|
||||
@@ -669,11 +669,11 @@
|
||||
" # StandardScaler(),\n",
|
||||
" # SVC(kernel='rbf', probability=True)\n",
|
||||
" # ),\n",
|
||||
" # \"SVM with StandardScaler and PCA\": make_pipeline(\n",
|
||||
" # StandardScaler(),\n",
|
||||
" # PCA(n_components=10),\n",
|
||||
" # SVC(kernel='rbf')\n",
|
||||
" # ),\n",
|
||||
" \"SVM with StandardScaler and PCA\": make_pipeline(\n",
|
||||
" StandardScaler(),\n",
|
||||
" PCA(n_components=10),\n",
|
||||
" SVC(kernel='rbf', probability=True)\n",
|
||||
" ),\n",
|
||||
"\n",
|
||||
" # \"XGBoost\": XGBClassifier()\n",
|
||||
" \"MLPClassifier\": make_pipeline(\n",
|
||||
@@ -818,8 +818,22 @@
|
||||
"source": [
|
||||
"# 4. Sensor A Validate on Dataset B\n",
|
||||
"from joblib import load\n",
|
||||
"svm_model = load('D:/thesis/models/sensor1/SVM.joblib')\n",
|
||||
"y_pred_svm_1 = svm_model.predict(X1b)"
|
||||
"svm_model = load('D:/thesis/models/Sensor A/SVM with StandardScaler and PCA.joblib')\n",
|
||||
"y_pred_svm_1 = svm_model.predict_proba(X1b)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\n",
|
||||
"\n",
|
||||
"# Set NumPy to display full decimal values\n",
|
||||
"np.set_printoptions(suppress=True, precision=6) # Suppress scientific notation, set precision to 6 decimals\n",
|
||||
"\n",
|
||||
"y_pred_svm_1[1]"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user