Delete dataset/legacy_enhanced_data
Browse filesThe telemetry code needs to be rework on
dataset/legacy_enhanced_data/compare_legacy_vs_v2.py
DELETED
|
@@ -1,68 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
# Compare YOUR legacy data with v2 telemetry data
|
| 3 |
-
import matplotlib.pyplot as plt
|
| 4 |
-
import seaborn as sns
|
| 5 |
-
|
| 6 |
-
def compare_legacy_vs_v2():
|
| 7 |
-
"""Compare legacy trading data with v2 telemetry"""
|
| 8 |
-
|
| 9 |
-
# Load legacy data
|
| 10 |
-
legacy_df = load_legacy_data()
|
| 11 |
-
|
| 12 |
-
# Load v2 data (current dataset)
|
| 13 |
-
from datasets import load_dataset
|
| 14 |
-
try:
|
| 15 |
-
v2_ds = load_dataset("rmems/Spikenaut-SNN-v2-Telemetry-Data-Weights-Parameters")
|
| 16 |
-
v2_df = v2_ds['train'].to_pandas()
|
| 17 |
-
print("✅ V2 dataset loaded")
|
| 18 |
-
except:
|
| 19 |
-
print("⚠️ V2 dataset not available, using sample")
|
| 20 |
-
v2_df = None
|
| 21 |
-
|
| 22 |
-
print("\n🔍 Dataset Comparison:")
|
| 23 |
-
print(f"Legacy: {len(legacy_df):,} records (trading focus)")
|
| 24 |
-
if v2_df is not None:
|
| 25 |
-
print(f"V2: {len(v2_df)} records (telemetry focus)")
|
| 26 |
-
|
| 27 |
-
# Compare time ranges
|
| 28 |
-
if 'timestamp' in legacy_df.columns:
|
| 29 |
-
legacy_df['timestamp'] = pd.to_datetime(legacy_df['timestamp'])
|
| 30 |
-
print(f"\n⏰ Time Coverage:")
|
| 31 |
-
print(f"Legacy: {legacy_df['timestamp'].min()} to {legacy_df['timestamp'].max()}")
|
| 32 |
-
print(f"Duration: {legacy_df['timestamp'].max() - legacy_df['timestamp'].min()}")
|
| 33 |
-
|
| 34 |
-
# Compare data types
|
| 35 |
-
print(f"\n📋 Data Types:")
|
| 36 |
-
print(f"Legacy focus: Trading actions, portfolio management, blockchain metrics")
|
| 37 |
-
if v2_df is not None:
|
| 38 |
-
print(f"V2 focus: Blockchain telemetry, spike encodings, SNN features")
|
| 39 |
-
|
| 40 |
-
# Visualize portfolio evolution (legacy)
|
| 41 |
-
if 'portfolio_value' in legacy_df.columns:
|
| 42 |
-
plt.figure(figsize=(12, 4))
|
| 43 |
-
|
| 44 |
-
plt.subplot(1, 2, 1)
|
| 45 |
-
# Sample every 1000th point for performance
|
| 46 |
-
sample_legacy = legacy_df.iloc[::1000]
|
| 47 |
-
plt.plot(sample_legacy.index, sample_legacy['portfolio_value'], alpha=0.7)
|
| 48 |
-
plt.title('🦁 Legacy Portfolio Evolution')
|
| 49 |
-
plt.xlabel('Record Index')
|
| 50 |
-
plt.ylabel('Portfolio Value ($)')
|
| 51 |
-
plt.grid(True, alpha=0.3)
|
| 52 |
-
|
| 53 |
-
# Action distribution
|
| 54 |
-
plt.subplot(1, 2, 2)
|
| 55 |
-
action_counts = legacy_df['action'].value_counts()
|
| 56 |
-
plt.pie(action_counts.values, labels=action_counts.index, autopct='%1.1f%%')
|
| 57 |
-
plt.title('Legacy Action Distribution')
|
| 58 |
-
|
| 59 |
-
plt.tight_layout()
|
| 60 |
-
plt.show()
|
| 61 |
-
|
| 62 |
-
print("\n🎯 Key Insights:")
|
| 63 |
-
print("• Legacy: Rich trading history with 200K+ records")
|
| 64 |
-
print("• V2: Focused telemetry with spike encodings")
|
| 65 |
-
print("• Combined: Complete picture of Spikenaut evolution")
|
| 66 |
-
|
| 67 |
-
# Run comparison
|
| 68 |
-
compare_legacy_vs_v2()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset/legacy_enhanced_data/legacy_summary_statistics.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"legacy_dataset_info": {
|
| 3 |
-
"total_records": 223020,
|
| 4 |
-
"file_size_mb": 182.3,
|
| 5 |
-
"date_range": {
|
| 6 |
-
"start": "2026-03-12T06:31:49.460483249+00:00",
|
| 7 |
-
"end": "2026-03-15T14:08:16.650911711+00:00"
|
| 8 |
-
},
|
| 9 |
-
"processing_date": "2026-03-23T07:13:53.008746"
|
| 10 |
-
},
|
| 11 |
-
"data_quality": {
|
| 12 |
-
"valid_json_rate": 100.0,
|
| 13 |
-
"completeness": {
|
| 14 |
-
"timestamp": 100.0,
|
| 15 |
-
"action": 100.0,
|
| 16 |
-
"portfolio_value": 100.0,
|
| 17 |
-
"price_usd": 100.0
|
| 18 |
-
}
|
| 19 |
-
},
|
| 20 |
-
"trading_metrics": {
|
| 21 |
-
"total_actions": 10000,
|
| 22 |
-
"observe_actions": 9936,
|
| 23 |
-
"buy_actions": 29,
|
| 24 |
-
"sell_actions": 35,
|
| 25 |
-
"portfolio_value_range": {
|
| 26 |
-
"min": 500.0,
|
| 27 |
-
"max": 1102.5507,
|
| 28 |
-
"mean": 990.2608183219999
|
| 29 |
-
}
|
| 30 |
-
},
|
| 31 |
-
"blockchain_metrics": {
|
| 32 |
-
"quai_block_utilization": {
|
| 33 |
-
"mean": 0.65,
|
| 34 |
-
"std": 0.0
|
| 35 |
-
},
|
| 36 |
-
"quai_gas_price": {
|
| 37 |
-
"mean": 10.0,
|
| 38 |
-
"std": 0.0
|
| 39 |
-
}
|
| 40 |
-
}
|
| 41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset/legacy_enhanced_data/load_legacy_data.py
DELETED
|
@@ -1,59 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
# Load and analyze YOUR massive legacy Spikenaut dataset
|
| 3 |
-
import json
|
| 4 |
-
import pandas as pd
|
| 5 |
-
import numpy as np
|
| 6 |
-
from pathlib import Path
|
| 7 |
-
|
| 8 |
-
def load_legacy_data(chunk_dir="legacy_enhanced_data"):
|
| 9 |
-
"""Load your enhanced legacy dataset"""
|
| 10 |
-
all_data = []
|
| 11 |
-
|
| 12 |
-
chunk_dir = Path(chunk_dir)
|
| 13 |
-
chunk_files = sorted(chunk_dir.glob("legacy_chunk_*.jsonl"))
|
| 14 |
-
|
| 15 |
-
print(f"🦁 Loading {len(chunk_files)} legacy data chunks...")
|
| 16 |
-
|
| 17 |
-
for chunk_file in chunk_files:
|
| 18 |
-
with open(chunk_file, 'r') as f:
|
| 19 |
-
for line in f:
|
| 20 |
-
if line.strip():
|
| 21 |
-
record = json.loads(line)
|
| 22 |
-
all_data.append(record)
|
| 23 |
-
|
| 24 |
-
df = pd.DataFrame(all_data)
|
| 25 |
-
print(f"✅ Loaded {len(df):,} records from legacy dataset")
|
| 26 |
-
|
| 27 |
-
return df
|
| 28 |
-
|
| 29 |
-
# Load your legacy data
|
| 30 |
-
legacy_df = load_legacy_data()
|
| 31 |
-
|
| 32 |
-
print("\n📊 Legacy Dataset Overview:")
|
| 33 |
-
print(f" Records: {len(legacy_df):,}")
|
| 34 |
-
print(f" Columns: {list(legacy_df.columns)}")
|
| 35 |
-
print(f" Date range: {legacy_df['timestamp'].min()} to {legacy_df['timestamp'].max()}")
|
| 36 |
-
|
| 37 |
-
# Analyze trading patterns
|
| 38 |
-
print("\n💰 Trading Analysis:")
|
| 39 |
-
action_counts = legacy_df['action'].value_counts()
|
| 40 |
-
for action, count in action_counts.items():
|
| 41 |
-
print(f" {action}: {count:,} ({count/len(legacy_df)*100:.1f}%)")
|
| 42 |
-
|
| 43 |
-
# Portfolio performance over time
|
| 44 |
-
if 'portfolio_value' in legacy_df.columns:
|
| 45 |
-
portfolio_stats = legacy_df['portfolio_value'].describe()
|
| 46 |
-
print(f"\n📈 Portfolio Performance:")
|
| 47 |
-
print(f" Initial: ${portfolio_stats['min']:.2f}")
|
| 48 |
-
print(f" Final: ${portfolio_stats['max']:.2f}")
|
| 49 |
-
print(f" Mean: ${portfolio_stats['mean']:.2f}")
|
| 50 |
-
print(f" Return: {(portfolio_stats['max']/500 - 1)*100:.2f}%")
|
| 51 |
-
|
| 52 |
-
# Blockchain health analysis
|
| 53 |
-
if 'blockchain_health_score' in legacy_df.columns:
|
| 54 |
-
health_stats = legacy_df['blockchain_health_score'].describe()
|
| 55 |
-
print(f"\n⛓️ Blockchain Health:")
|
| 56 |
-
print(f" Mean score: {health_stats['mean']:.3f}")
|
| 57 |
-
print(f" Health trend: {'Improving' if health_stats['mean'] > 0.6 else 'Stable' if health_stats['mean'] > 0.4 else 'Declining'}")
|
| 58 |
-
|
| 59 |
-
print("\n🎉 Your legacy dataset shows rich trading and blockchain telemetry!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|