feat: implement comprehensive land cover classification pipeline with model benchmarking and experiment logging
This commit is contained in:
+21
-5
@@ -26,7 +26,23 @@ if os.path.exists("model_xgboost_info.json"):
|
||||
for info_file in glob.glob("model_train/*_info.json"):
|
||||
with open(info_file, 'r') as f:
|
||||
data = json.load(f)
|
||||
if 'accuracy' not in data and 'f1_score' not in data:
|
||||
# Support both 'accuracy' and 'test_accuracy'
|
||||
acc = data.get('accuracy', data.get('test_accuracy', ''))
|
||||
|
||||
f1 = data.get('f1_score', '')
|
||||
precision = data.get('precision', '')
|
||||
recall = data.get('recall', '')
|
||||
|
||||
clf_rep = data.get('classification_report')
|
||||
if isinstance(clf_rep, dict) and 'macro avg' in clf_rep:
|
||||
if not f1:
|
||||
f1 = clf_rep['macro avg'].get('f1-score', '')
|
||||
if not precision:
|
||||
precision = clf_rep['macro avg'].get('precision', '')
|
||||
if not recall:
|
||||
recall = clf_rep['macro avg'].get('recall', '')
|
||||
|
||||
if not acc and not f1:
|
||||
continue
|
||||
|
||||
params = data.get('params', {})
|
||||
@@ -37,10 +53,10 @@ for info_file in glob.glob("model_train/*_info.json"):
|
||||
|
||||
land_data.append([
|
||||
data.get('model_type', ''),
|
||||
data.get('accuracy', ''),
|
||||
data.get('precision', ''),
|
||||
data.get('recall', ''),
|
||||
data.get('f1_score', ''),
|
||||
acc,
|
||||
precision,
|
||||
recall,
|
||||
f1,
|
||||
param_str
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user