FelixPhilip commited on
Commit
6a89c42
·
1 Parent(s): a8c59f7

Oracle model update

Browse files
Files changed (1) hide show
  1. Oracle/deepfundingoracle.py +2 -3
Oracle/deepfundingoracle.py CHANGED
@@ -238,10 +238,9 @@ def train_predict_weight(df):
238
  start_time = time.time()
239
  target = "base_weight"
240
  if "activity" in df.columns:
241
- # Parse ISO timestamps as UTC, then drop timezone for subtraction
242
  df["activity"] = pd.to_datetime(df["activity"], errors="coerce", utc=True)
243
- df["activity"] = df["activity"].dt.tz_convert(None)
244
- now = pd.Timestamp.utcnow()
245
  df["activity"] = (now - df["activity"]).dt.days.fillna(-1)
246
  feature_cols = ["stars", "forks", "watchers", "open_issues", "pulls", "activity", "contributors"]
247
  if target not in df.columns:
 
238
  start_time = time.time()
239
  target = "base_weight"
240
  if "activity" in df.columns:
241
+ # Parse ISO timestamps as UTC and subtract with a UTC timestamp
242
  df["activity"] = pd.to_datetime(df["activity"], errors="coerce", utc=True)
243
+ now = pd.Timestamp.now(tz="UTC")
 
244
  df["activity"] = (now - df["activity"]).dt.days.fillna(-1)
245
  feature_cols = ["stars", "forks", "watchers", "open_issues", "pulls", "activity", "contributors"]
246
  if target not in df.columns: