-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
37 lines (26 loc) · 1.03 KB
/
run.py
File metadata and controls
37 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
from fix_data import transform_data
from train_model import train_and_evaluate
def main():
print("=" * 60)
print("Decision Tree for Sleep Disorder Detection")
print("=" * 60)
project_root = os.path.dirname(os.path.abspath(__file__))
print("\n[Step 1/2] Preprocessing data...")
input_file = os.path.join(project_root, 'data', 'original-dataset.csv')
output_file = os.path.join(project_root, 'data', 'fixed-dataset.csv')
if not os.path.exists(input_file):
print(f"Error: Input file not found at {input_file}")
sys.exit(1)
transform_data(input_file, output_file)
print("\n[Step 2/2] Training decision tree model...")
train_and_evaluate()
print("\n" + "=" * 60)
print("Pipeline completed successfully!")
print("=" * 60)
print(f"Results saved to: {os.path.join(project_root, 'output', 'result.txt')}")
if __name__ == "__main__":
main()