cyberosa commited on
Commit
746d43a
·
1 Parent(s): 807709a

daily data and final adjustments on global accuracy

Browse files
all_trades_profitability.parquet.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e81309542a8f2f12f428d72051434d76a0888958c87af859c18f882832526b80
3
- size 16070269
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb4a8ccc5e2abcc7e80c45b0c929d5192a725a6e974ced43847d147bcf77786f
3
+ size 16479153
closed_market_metrics.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7757f7a925335d2a7a2fb293203d7d6c3959105de39f1ea7e1c07a171052fb7b
3
- size 141658
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83a67273a55d3ab3518e705bf0a1c73ffe3aa9d3a76a4baca781d7dbf8bb6b1d
3
+ size 141356
closed_markets_div.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f7eb9b2faac6fe9215612247ae97be15c033986ca23d837234efeb9c33721f2d
3
- size 89685
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:557e65dcce4b162d118822c7cd5455fdc986139d2c3b0a12d28adbea446fac11
3
+ size 89935
daily_info.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6e0fd1a20eab9a86c2c7a127b617bd6a24842e8cbcf228e5bbefa67ec51b7ceb
3
- size 3740591
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f2fdf2405ca21996b8136d3babb1b0b56d3d42b6ca9f622298d12728126488b
3
+ size 3517240
daily_mech_requests.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6152d46f22d8dc7eb62d947c1824985b7e9def2ed330854e5816668535d0d1c2
3
- size 10531
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a24132e42742579305344be7dfa8b23a2539670e27b295015192cfecd3f9760b
3
+ size 10316
daily_mech_requests_by_pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fd6cd2a72faf3ce3ea7f83946a853414c5f39792c009f4617c1713ac955b6b19
3
- size 4506
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26e4a9290d8150ff29734468a294915b9572eac83ac6def4e46c295cb64bd5c2
3
+ size 4526
error_by_markets.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7e1855af8d28121f831805e36df9ad1a6117061172bc2176757580eb758e90ad
3
- size 11403
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6112cb0c58ed06facc29fc8d1eef9338331e4ed76efbe7a0769a8cd68750084
3
+ size 11387
errors_by_mech.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4d592629d501ab3cabee10e9147b7dcd781e02ee34927f04dcabb2103992e10a
3
- size 6120
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44839b352c199d601943a336c83843a37323325db578f481f08e93394bbf5d08
3
+ size 6130
invalid_trades.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ff3c8a20d9160e2a805446d698ba8e1b181e6110a66c604417b0b195c52c6f5d
3
- size 318292
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e78daee380cc606505c2ecdf2daf19a47519deadee4e9beda8dff02b3628cc01
3
+ size 346080
latest_result_DAA_Pearl.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:111c9b3c18d96a97d3f36b183be43de6a76d243fa9f92286141a45a32cf3d143
3
- size 5410
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4d86beafcff5561de3de7e006446ddd310cb0ecd2ab59b2c6d6740c524fa4f5
3
+ size 5441
latest_result_DAA_QS.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ae36ab1e7967f62ec9aa93a3bc51491e5d26a1bdef75c7c02c444b831aad3458
3
- size 5984
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2775e5b3d9f7f7d6adc41469c9d8cba348fd2fb8ba44e25013b9f9adc5794b35
3
+ size 6032
pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5831e061a9b023b2ad9145e058d85835e4e08afaed105be1a24b6da07d6a05d9
3
- size 47185
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f3f0f0d51bc5055ed8cbab38440c5ce6811c5d6e434c28daa7f11b141e64f26
3
+ size 47212
retention_activity.parquet.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ec0a31d9867168c45b195e1f0d52385807321c5dfce0e3cfd5b85b0d8b2fb0d3
3
- size 4638312
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a66f63d6c55f668fdac2b21ad54113b8e5b89eda858007695260993204fc4725
3
+ size 4535263
scripts/daily_data.py CHANGED
@@ -38,7 +38,7 @@ def prepare_live_metrics(
38
  all_trades_df = analyse_all_traders(fpmmTrades, trader_mech_calls, daily_info=True)
39
 
40
  # staking label
41
- all_trades_df = label_trades_by_staking(all_trades_df)
42
 
43
  # create the unknown traders dataset
44
  unknown_traders_df, all_trades_df = create_unknown_traders_df(
 
38
  all_trades_df = analyse_all_traders(fpmmTrades, trader_mech_calls, daily_info=True)
39
 
40
  # staking label
41
+ all_trades_df = label_trades_by_staking(all_trades_df, start=1)
42
 
43
  # create the unknown traders dataset
44
  unknown_traders_df, all_trades_df = create_unknown_traders_df(
scripts/pull_data.py CHANGED
@@ -136,7 +136,7 @@ def only_new_weekly_analysis():
136
 
137
  save_historical_data()
138
  try:
139
- clean_old_data_from_parquet_files("2025-05-20")
140
  clean_old_data_from_json_files()
141
  except Exception as e:
142
  print("Error cleaning the oldest information from parquet files")
 
136
 
137
  save_historical_data()
138
  try:
139
+ clean_old_data_from_parquet_files("2025-05-23")
140
  clean_old_data_from_json_files()
141
  except Exception as e:
142
  print("Error cleaning the oldest information from parquet files")
scripts/staking.py CHANGED
@@ -138,7 +138,7 @@ def get_service_data(service_registry: Any, service_id: int) -> dict:
138
  return tmp_map
139
 
140
 
141
- def update_service_map(start: int = 1, end: int = 2500):
142
  if os.path.exists(ROOT_DIR / "service_map.pkl"):
143
  with open(ROOT_DIR / "service_map.pkl", "rb") as f:
144
  service_map = pickle.load(f)
 
138
  return tmp_map
139
 
140
 
141
+ def update_service_map(start: int = 1, end: int = 2800):
142
  if os.path.exists(ROOT_DIR / "service_map.pkl"):
143
  with open(ROOT_DIR / "service_map.pkl", "rb") as f:
144
  service_map = pickle.load(f)
scripts/update_tools_accuracy.py CHANGED
@@ -306,51 +306,52 @@ def compute_global_accuracy_same_population(
306
  # first historical file download
307
  tool_names = list(more_sample_tools.keys())
308
  print(f"Tools with not enough samples: {tool_names}")
309
- # Disbling the historical file download til we have enough old samples from "2025-06-03" (Latest model update)
310
- # TODO reactivate the historical file download from 2025-08-16
311
- # tools_historical_file = download_tools_historical_files(
312
- # client, exclude_filename=None
313
- # )
314
- # adding_historical_data(
315
- # tools_historical_file,
316
- # tools_df,
317
- # more_sample_tools,
318
- # sample_size,
319
- # valid_tools,
320
- # global_accuracies,
321
- # )
322
- # if len(more_sample_tools) > 0:
323
- # # second historical file download
324
- # tools_historical_file2 = download_tools_historical_files(
325
- # client,
326
- # exclude_filename=tools_historical_file,
327
- # )
328
- # adding_historical_data(
329
- # tools_historical_file2,
330
- # tools_df,
331
- # more_sample_tools,
332
- # sample_size,
333
- # valid_tools,
334
- # global_accuracies,
335
- # )
336
  # if not enough samples found in the historical data, upsample the tools that need more samples
337
  # Process tools that need upsampling
 
338
  for tool in more_sample_tools.keys():
339
- if more_sample_tools[tool] < SAMPLES_THRESHOLD:
340
- # assign the default accuracy
341
- print(f"Tool {tool} has not enough samples, assigning default accuracy")
342
- global_accuracies[tool] = {
343
- "mean": DEFAULT_ACCURACY,
344
- "std": 0.0, # No standard deviation for a single sample
345
- }
346
- continue
347
- print(f"Upsampling tool: {tool}")
348
- tool_samples = tools_df[tools_df["tool"] == tool]
349
- upsampled_sets = upsample_tool_multiple(tool_samples, sample_size, n_subsets)
 
350
 
351
- tool_mean_accuracy, tool_std = compute_tool_estimated_accuracy(upsampled_sets)
352
- global_accuracies[tool] = {"mean": float(tool_mean_accuracy), "std": tool_std}
353
- return global_accuracies
354
 
355
 
356
  def get_accuracy_info(tools_df: pd.DataFrame) -> [pd.DataFrame, bool, Dict]:
@@ -359,14 +360,15 @@ def get_accuracy_info(tools_df: pd.DataFrame) -> [pd.DataFrame, bool, Dict]:
359
  """
360
  clean_tools_df = clean_tools_dataset(tools_df)
361
  # compute global accuracy information for the tools
362
- global_accuracies = compute_global_accuracy_same_population(tools_df=clean_tools_df)
 
 
363
  # transform the dictionary global_accuracies into a DataFrame
364
  wins = pd.DataFrame(
365
  [
366
  {
367
  "tool": tool,
368
  "tool_accuracy": global_accuracies[tool]["mean"],
369
- "std_accuracy": global_accuracies[tool]["std"],
370
  "total_requests": clean_tools_df[clean_tools_df["tool"] == tool].shape[
371
  0
372
  ],
@@ -385,7 +387,7 @@ def get_accuracy_info(tools_df: pd.DataFrame) -> [pd.DataFrame, bool, Dict]:
385
  print("NO REQUEST TIME INFORMATION AVAILABLE")
386
  no_timeline_info = True
387
  acc_info = wins
388
- return acc_info, no_timeline_info
389
 
390
 
391
  def update_tools_accuracy_same_model(
@@ -395,7 +397,7 @@ def update_tools_accuracy_same_model(
395
 
396
  # computation of the accuracy information
397
  tools_inc = tools_df[tools_df["tool"].isin(inc_tools)]
398
- acc_info, no_timeline_info = get_accuracy_info(tools_inc)
399
 
400
  if tools_acc is None:
401
  print("Creating accuracy file for the first time")
@@ -409,9 +411,10 @@ def update_tools_accuracy_same_model(
409
  # dt.strftime("%Y-%m-%d %H:%M:%S")
410
  acc_info["min"] = acc_info["min"].dt.strftime("%Y-%m-%d %H:%M:%S")
411
  acc_info["max"] = acc_info["max"].dt.strftime("%Y-%m-%d %H:%M:%S")
412
- new_tools = []
413
  all_accuracies = []
414
  for tool in tools_to_update:
 
 
415
  new_accuracy = round(
416
  acc_info[acc_info["tool"] == tool]["tool_accuracy"].values[0], 2
417
  )
 
306
  # first historical file download
307
  tool_names = list(more_sample_tools.keys())
308
  print(f"Tools with not enough samples: {tool_names}")
309
+
310
+ tools_historical_file = download_tools_historical_files(
311
+ client, exclude_filename=None
312
+ )
313
+ adding_historical_data(
314
+ tools_historical_file,
315
+ tools_df,
316
+ more_sample_tools,
317
+ sample_size,
318
+ valid_tools,
319
+ global_accuracies,
320
+ )
321
+ if len(more_sample_tools) > 0:
322
+ # second historical file download
323
+ tools_historical_file2 = download_tools_historical_files(
324
+ client,
325
+ exclude_filename=tools_historical_file,
326
+ )
327
+ adding_historical_data(
328
+ tools_historical_file2,
329
+ tools_df,
330
+ more_sample_tools,
331
+ sample_size,
332
+ valid_tools,
333
+ global_accuracies,
334
+ )
 
335
  # if not enough samples found in the historical data, upsample the tools that need more samples
336
  # Process tools that need upsampling
337
+ new_tools = []
338
  for tool in more_sample_tools.keys():
339
+ # assign the default accuracy
340
+ print(f"Tool {tool} has not enough samples, assigning default accuracy")
341
+ global_accuracies[tool] = {
342
+ "mean": DEFAULT_ACCURACY,
343
+ "std": 0.0, # No standard deviation for a single sample
344
+ }
345
+ if more_sample_tools[tool] > SAMPLES_THRESHOLD:
346
+ # new tool but not reaching yet the population size
347
+ new_tools.append(tool)
348
+ # print(f"Upsampling tool: {tool}")
349
+ # tool_samples = tools_df[tools_df["tool"] == tool]
350
+ # upsampled_sets = upsample_tool_multiple(tool_samples, sample_size, n_subsets)
351
 
352
+ # tool_mean_accuracy, tool_std = compute_tool_estimated_accuracy(upsampled_sets)
353
+ # global_accuracies[tool] = {"mean": float(tool_mean_accuracy), "std": tool_std}
354
+ return global_accuracies, new_tools
355
 
356
 
357
  def get_accuracy_info(tools_df: pd.DataFrame) -> [pd.DataFrame, bool, Dict]:
 
360
  """
361
  clean_tools_df = clean_tools_dataset(tools_df)
362
  # compute global accuracy information for the tools
363
+ global_accuracies, new_tools = compute_global_accuracy_same_population(
364
+ tools_df=clean_tools_df
365
+ )
366
  # transform the dictionary global_accuracies into a DataFrame
367
  wins = pd.DataFrame(
368
  [
369
  {
370
  "tool": tool,
371
  "tool_accuracy": global_accuracies[tool]["mean"],
 
372
  "total_requests": clean_tools_df[clean_tools_df["tool"] == tool].shape[
373
  0
374
  ],
 
387
  print("NO REQUEST TIME INFORMATION AVAILABLE")
388
  no_timeline_info = True
389
  acc_info = wins
390
+ return acc_info, no_timeline_info, new_tools
391
 
392
 
393
  def update_tools_accuracy_same_model(
 
397
 
398
  # computation of the accuracy information
399
  tools_inc = tools_df[tools_df["tool"].isin(inc_tools)]
400
+ acc_info, no_timeline_info, new_tools = get_accuracy_info(tools_inc)
401
 
402
  if tools_acc is None:
403
  print("Creating accuracy file for the first time")
 
411
  # dt.strftime("%Y-%m-%d %H:%M:%S")
412
  acc_info["min"] = acc_info["min"].dt.strftime("%Y-%m-%d %H:%M:%S")
413
  acc_info["max"] = acc_info["max"].dt.strftime("%Y-%m-%d %H:%M:%S")
 
414
  all_accuracies = []
415
  for tool in tools_to_update:
416
+ if tool in new_tools:
417
+ continue
418
  new_accuracy = round(
419
  acc_info[acc_info["tool"] == tool]["tool_accuracy"].values[0], 2
420
  )
service_map.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5db33e88c385c42e5d3e912b205f076eacca314990f6434c6b59ad15ab30fcdf
3
- size 170721
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a86c92014d50b69557b6d69af5db4c436a52c484552cb815073a0cb59e4d04bf
3
+ size 170872
tools_accuracy.csv CHANGED
@@ -1,13 +1,13 @@
1
  tool,tool_accuracy,total_requests,min,max
2
- claude-prediction-offline,61.25,800,2025-06-06 00:13:05,2025-07-20 23:30:50
3
- claude-prediction-online,44.25,800,2025-06-11 07:23:05,2025-07-20 23:10:30
4
- prediction-offline,66.25,800,2025-06-03 00:00:05,2025-07-20 23:42:15
5
- prediction-offline-sme,56.44,800,2025-06-03 11:55:10,2025-07-17 12:28:50
6
- prediction-online,48.25,800,2025-06-03 00:00:05,2025-07-20 23:41:50
7
- prediction-online-sme,61.12,800,2025-06-03 00:04:30,2025-07-20 23:38:00
8
- prediction-request-rag,43.25,800,2025-06-03 18:59:40,2025-07-20 23:38:30
9
- prediction-request-rag-claude,44.38,800,2025-06-03 17:51:10,2025-07-20 19:25:25
10
- prediction-request-reasoning,54.25,800,2025-06-03 00:00:30,2025-07-20 23:43:45
11
- prediction-request-reasoning-claude,53.5,800,2025-06-16 11:02:15,2025-07-20 17:57:35
12
- prediction-url-cot-claude,51.0,800,2025-06-12 20:36:25,2025-07-01 07:40:40
13
- superforcaster,62.75,800,2025-06-03 01:15:10,2025-07-20 23:42:00
 
1
  tool,tool_accuracy,total_requests,min,max
2
+ claude-prediction-offline,61.25,800,2025-06-06 00:13:05,2025-07-23 22:52:15
3
+ claude-prediction-online,51.12,800,2025-06-11 07:23:05,2025-07-23 23:44:45
4
+ prediction-offline,67.62,800,2025-06-03 00:00:05,2025-07-23 23:44:45
5
+ prediction-offline-sme,56.09,800,2025-06-03 11:55:10,2025-07-21 10:13:15
6
+ prediction-online,69.62,800,2025-06-03 00:00:05,2025-07-23 23:44:45
7
+ prediction-online-sme,51.88,800,2025-06-03 00:04:30,2025-07-23 23:30:15
8
+ prediction-request-rag,65.12,800,2025-06-03 18:59:40,2025-07-23 23:13:00
9
+ prediction-request-rag-claude,44.88,800,2025-06-03 17:51:10,2025-07-23 22:01:40
10
+ prediction-request-reasoning,71.5,800,2025-06-03 00:00:30,2025-07-23 23:30:15
11
+ prediction-request-reasoning-claude,55.0,800,2025-06-16 11:02:15,2025-07-23 14:13:35
12
+ prediction-url-cot-claude,42.86,800,2025-06-12 20:36:25,2025-07-01 07:40:40
13
+ superforcaster,64.88,800,2025-06-03 01:15:10,2025-07-23 23:24:05
traders_weekly_metrics.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:83242bb6c467bb2853241ad006f3e0e0f36d1bfe314617ecf3325b5e78d70748
3
- size 183572
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4b0713fe419831e1be87504e4ddcbd19d3165196ce56d931e46515fbbbd4d7e
3
+ size 194491
two_weeks_avg_roi_pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:93cd2ce2268f51bafc485cc3591131d3523b9e0e062cb175b73560f1f4492e98
3
- size 3045
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c84c74cc5304aedee5ab4a710b293a1c04d5b1eb6723b13ae87d06b3ee711c23
3
+ size 3057
unknown_traders.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2d7c14dfb3e4e42ded248b730c1724a5b0c613652f8e4dca2eabe67232f2bcea
3
- size 1470048
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01fb067035a2a0fa8e7dc3a86e698fff5cc31e3f6e19cf240aceeb3dcdebff0d
3
+ size 1482383
weekly_avg_roi_pearl_agents.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ab3f6ebefefe6adff65db1a290d2490f6dc167da80edc2cce7023bf6e6acecbb
3
- size 2396
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5c4c0c2f6f22facb7fb4b55d0f08ee6162292ef39138ad8810660065ee39083
3
+ size 2413
weekly_mech_calls.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5ca2ede608f554c0768988cd81143164fc0c22cf00923ddd435123aece31654d
3
- size 53756
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7b4cdcce289a7a8e5ad7366c78725684ef6943f80ab9ec58ce854d57b9fc591
3
+ size 52747
winning_df.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:13e8223c0237aa3646c6087dd734acae967e986a1f0b79eaa4db2b9e46aa8594
3
- size 10996
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e87b370be0f3d031bc042404da06c0190d28d11862ba1cc66731c333b856f563
3
+ size 11428