FelixPhilip commited on
Commit
72bbd9f
·
1 Parent(s): 16532e0

Oracle model update

Browse files
Files changed (1) hide show
  1. Oracle/deepfundingoracle.py +4 -0
Oracle/deepfundingoracle.py CHANGED
@@ -237,6 +237,10 @@ def train_predict_weight(df):
237
  print("[INFO] Starting weight prediction...", flush=True)
238
  start_time = time.time()
239
  target = "base_weight"
 
 
 
 
240
  feature_cols = ["stars", "forks", "watchers", "open_issues", "pulls", "activity", "contributors"]
241
  if target not in df.columns:
242
  raise ValueError("Base weight column missing.")
 
237
  print("[INFO] Starting weight prediction...", flush=True)
238
  start_time = time.time()
239
  target = "base_weight"
240
+ if "activity" in df.columns:
241
+ df["activity"] = pd.to_datetime(df["activity"], errors="coerce")
242
+ now = pd.Timestamp.now()
243
+ df["activity"] = (now - df["activity"]).dt.days.fillna(-1)
244
  feature_cols = ["stars", "forks", "watchers", "open_issues", "pulls", "activity", "contributors"]
245
  if target not in df.columns:
246
  raise ValueError("Base weight column missing.")