subbunanepalli commited on
Commit
0aed451
·
verified ·
1 Parent(s): 8fac867

Update config.py

Browse files
Files changed (1) hide show
  1. config.py +9 -18
config.py CHANGED
@@ -1,36 +1,27 @@
1
  import os
2
 
3
- # === Base Directory ===
4
  BASE_DIR = os.path.abspath(os.path.dirname(__file__))
5
-
6
- # === Dataset Path ===
7
  DATA_PATH = os.path.join(BASE_DIR, "data", "synthetic_transactions_samples_5000.csv")
8
 
9
- # === Model Save Paths ===
10
- MODEL_SAVE_DIR = os.path.join(BASE_DIR, "models")
11
- os.makedirs(MODEL_SAVE_DIR, exist_ok=True)
12
-
13
- MODEL_SAVE_DIR = "/tmp"
14
  MODEL_PATH = os.path.join(MODEL_SAVE_DIR, "logreg_model.pkl")
15
  TFIDF_VECTORIZER_PATH = os.path.join(MODEL_SAVE_DIR, "tfidf_vectorizer.pkl")
16
  LABEL_ENCODERS_PATH = os.path.join(MODEL_SAVE_DIR, "label_encoders.pkl")
17
 
18
- # === Columns ===
19
  TEXT_COLUMN = "Sanction_Context"
20
  LABEL_COLUMNS = [
21
- "Red_Flag_Reason",
22
- "Maker_Action",
23
- "Escalation_Level",
24
- "Risk_Category",
25
- "Risk_Drivers",
26
- "Investigation_Outcome"
27
  ]
28
 
29
- # === TF-IDF Settings ===
30
  TFIDF_MAX_FEATURES = 5000
31
  NGRAM_RANGE = (1, 2)
32
  USE_STOPWORDS = True
33
 
34
- # === Train/Test Split Settings ===
35
- TEST_SIZE = 0.2
36
  RANDOM_STATE = 42
 
 
1
  import os
2
 
3
+ # --- Dataset Path ---
4
  BASE_DIR = os.path.abspath(os.path.dirname(__file__))
 
 
5
  DATA_PATH = os.path.join(BASE_DIR, "data", "synthetic_transactions_samples_5000.csv")
6
 
7
+ # --- Use writable directory ---
8
+ MODEL_SAVE_DIR = "/tmp" # ✅ No permission issues
 
 
 
9
  MODEL_PATH = os.path.join(MODEL_SAVE_DIR, "logreg_model.pkl")
10
  TFIDF_VECTORIZER_PATH = os.path.join(MODEL_SAVE_DIR, "tfidf_vectorizer.pkl")
11
  LABEL_ENCODERS_PATH = os.path.join(MODEL_SAVE_DIR, "label_encoders.pkl")
12
 
13
+ # --- Columns ---
14
  TEXT_COLUMN = "Sanction_Context"
15
  LABEL_COLUMNS = [
16
+ "Red_Flag_Reason", "Maker_Action", "Escalation_Level",
17
+ "Risk_Category", "Risk_Drivers", "Investigation_Outcome"
 
 
 
 
18
  ]
19
 
20
+ # --- TF-IDF Settings ---
21
  TFIDF_MAX_FEATURES = 5000
22
  NGRAM_RANGE = (1, 2)
23
  USE_STOPWORDS = True
24
 
25
+ # --- Train/Test Split ---
 
26
  RANDOM_STATE = 42
27
+ TEST_SIZE = 0.2