27 lines
854 B
Python
27 lines
854 B
Python
from train_module import train_model
|
|
|
|
def main():
|
|
print("🚀 BẮT ĐẦU HUẤN LUYỆN MÔ HÌNH RANDOM FOREST (GPU & CACHE)")
|
|
|
|
params = {
|
|
'bbox': [105.5, 9.2, 106.3, 10.0],
|
|
'time_range': '2023-01-01/2023-04-30',
|
|
'model_type': 'random_forest',
|
|
'feature_mode': 'extended',
|
|
'use_cache': True,
|
|
'use_gpu': True,
|
|
'output_model_path': 'land_classification_model/model_random_forest_auto.joblib', 'n_estimators': 100, 'max_depth': 15
|
|
}
|
|
|
|
try:
|
|
res = train_model(**params)
|
|
if res.get('success'):
|
|
print(f"✅ Hoàn thành! Accuracy: {res.get('test_accuracy', 0.0):.4f}")
|
|
else:
|
|
print(f"❌ Thất bại: {res.get('error', 'Unknown')}")
|
|
except Exception as e:
|
|
print(f"❌ Lỗi: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|