Sfoglia il codice sorgente

update of joblib import

Jérôme BUISINE 4 anni fa
parent
commit
c8661eab58
3 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 3 0
      generate/generate_data_model.py
  2. 3 0
      run.sh
  3. 2 1
      train_model.py

+ 3 - 0
generate/generate_data_model.py

@@ -250,6 +250,8 @@ def main():
         index = scenes_indices.index(scene_id.strip())
         scenes_selected.append(scenes_list[index])
 
+    print(scenes_selected)
+
     # find min max value if necessary to renormalize data
     if p_custom:
         get_min_max_value_interval(scenes_list, p_interval, p_feature)
@@ -265,6 +267,7 @@ def main():
             f.write(str(min_value_interval) + '\n')
             f.write(str(max_value_interval) + '\n')
 
+
     # create database using img folder (generate first time only)
     generate_data_model(p_filename, p_interval, p_kind, p_feature, scenes_selected, p_zones, p_percent, p_step, p_each, p_custom)
 

+ 3 - 0
run.sh

@@ -0,0 +1,3 @@
+python generate/generate_all_data.py --feature filters_statistics
+python generate/generate_data_model.py --interval 0,26 --kind svdn --feature filters_statistics --scenes A,B,C,D,E,F --zones 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 --output data/26_attributes_data --each 1 --kind svdn
+python train_model.py --data data/26_attributes_data --output 26_attributes_model --choice svm_model

+ 2 - 1
train_model.py

@@ -11,7 +11,8 @@ from sklearn.ensemble import RandomForestClassifier, VotingClassifier
 
 import sklearn.svm as svm
 from sklearn.utils import shuffle
-from sklearn.externals import joblib
+#from sklearn.externals import joblib
+import joblib
 from sklearn.metrics import accuracy_score, f1_score
 from sklearn.model_selection import cross_val_score