Spaces:
Sleeping
Sleeping
Commit
·
a8c59f7
1
Parent(s):
72bbd9f
Oracle model update
Browse files
Oracle/deepfundingoracle.py
CHANGED
@@ -238,8 +238,10 @@ def train_predict_weight(df):
|
|
238 |
start_time = time.time()
|
239 |
target = "base_weight"
|
240 |
if "activity" in df.columns:
|
241 |
-
|
242 |
-
|
|
|
|
|
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:
|
|
|
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:
|