Browse Source

use of SVM as desired model

Jérôme BUISINE 1 year ago
parent
commit
4fc3142e09
2 changed files with 10 additions and 10 deletions
  1. 3 3
      find_best_attributes_surrogate.py
  2. 7 7
      run_surrogate_rendering.sh

+ 3 - 3
find_best_attributes_surrogate.py

@@ -175,9 +175,9 @@ def main():
             y_train_filters = self._data['y_train']
             x_test_filters = self._data['x_test'].iloc[:, indices]
             
-            # model = _get_best_model(x_train_filters, y_train_filters)
-            model = RandomForestClassifier(n_estimators=500, class_weight='balanced', bootstrap=True, max_samples=0.75, n_jobs=-1)
-            model = model.fit(x_train_filters, y_train_filters)
+            model = _get_best_model(x_train_filters, y_train_filters)
+            # model = RandomForestClassifier(n_estimators=500, class_weight='balanced', bootstrap=True, max_samples=0.75, n_jobs=-1)
+            # model = model.fit(x_train_filters, y_train_filters)
             
             y_test_model = model.predict(x_test_filters)
             test_roc_auc = roc_auc_score(self._data['y_test'], y_test_model)

+ 7 - 7
run_surrogate_rendering.sh

@@ -1,7 +1,7 @@
 #! /bin/bash
 
 # default param
-ILS=2000
+ILS=1000
 LS=100
 SS=50
 LENGTH=32 # number of features
@@ -13,18 +13,18 @@ TRAIN_EVERY=10
 #output="rendering-attributes-ILS_${ILS}-POP_${POP}-LS_${LS}-SS_${SS}-SO_${ORDER}-SE_${TRAIN_EVERY}"
 DATASET="rnn/data/datasets/features-selection-rendering-scaled/features-selection-rendering-scaled"
 
-for run in {1,2,3,4,5,6,7,8,9,10};
+for run in {1,2,3,4,5};
 do
-    for POP in {20,60,100};
-    do
-        for ORDER in {1,2,3};
+    # for POP in {20,60,100};
+    # do
+        for ORDER in {1,2};
         do
-            for LS in {1000,5000,10000};
+            for LS in {100,500,1000};
             do
                 output="rendering-attributes-POP_${POP}-LS_${LS}-SS_${SS}-SO_${ORDER}-SE_${TRAIN_EVERY}-RUN_${run}"
                 echo "Run optim attributes using: ${output}"
                 python find_best_attributes_surrogate.py --data ${DATASET} --start_surrogate ${SS} --length 32 --ils ${ILS} --ls ${LS} --pop ${POP} --order ${ORDER} --train_every ${TRAIN_EVERY}  --output ${output}
             done
         done
-    done
+    # done
 done