-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_enhanced_maps.py
More file actions
64 lines (52 loc) · 2.31 KB
/
test_enhanced_maps.py
File metadata and controls
64 lines (52 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python3
"""
Test enhanced perceptual maps with realistic data
"""
import pandas as pd
from data_driven_analyzer import DataDrivenAnalyzer
import matplotlib.pyplot as plt
def test_enhanced_maps():
"""Test the enhanced map generation with realistic data."""
print("🧪 Testing Enhanced Perceptual Maps")
print("=" * 40)
# Load the example data
try:
df = pd.read_csv('example_flexible_data.csv')
print(f"✅ Loaded data: {len(df)} services")
# Create analyzer
analyzer = DataDrivenAnalyzer(df)
# Get analysis summary
summary = analyzer.get_analysis_summary()
print(f"📊 Available dimensions: {summary['available_dimensions']}")
print(f"📈 Total brands: {summary['brands']}")
# Test different combinations
test_combinations = [
('content_quality', 'user_interface', 'Quality vs UX'),
('performance', 'price_value', 'Performance vs Value'),
('brand_trust', 'innovation', 'Trust vs Innovation')
]
for x_dim, y_dim, description in test_combinations:
if x_dim in summary['available_dimensions'] and y_dim in summary['available_dimensions']:
print(f"\n🎨 Creating {description} map...")
# Create enhanced map
filename = f"enhanced_{x_dim}_vs_{y_dim}_test.png"
fig, ax = analyzer.create_perceptual_map(
x_dim, y_dim,
save_path=f"results/{filename}"
)
plt.close(fig) # Clean up
print(f" ✅ Saved: {filename}")
print(f"\n🎉 Enhanced maps created! Key improvements:")
print(f" • Professional brand colors")
print(f" • Smart labels with leader lines")
print(f" • Quadrant analysis (Leaders, Niche Players, etc.)")
print(f" • Enhanced bubble sizing")
print(f" • Professional legends and styling")
print(f" • Grid and reference lines")
except Exception as e:
print(f"❌ Error: {e}")
if __name__ == "__main__":
# Set matplotlib backend for headless operation
import matplotlib
matplotlib.use('Agg')
test_enhanced_maps()