I have successfully implemented comprehensive process mining functionality for the funnel analytics platform according to your specifications.
PathAnalyzer.discover_process_mining_structure()method- Automatic detection of user journey processes from event data
- Smart frequency filtering with dynamic thresholds
- Robust data type handling with Polars-first approach
FunnelVisualizer.create_process_mining_diagram()method- BPMN-style interactive diagrams with Plotly
- Multiple layout algorithms: hierarchical, force, circular
- Activity nodes with frequency-based sizing
- Transition arrows with probability and frequency display
- Cycle detection with visual indicators
- New 🔍 Process Mining tab in the main interface
- Configurable analysis parameters:
- Minimum transition frequency slider
- Cycle detection toggle
- Layout algorithm selection
- Frequency display options
- Professional dark theme with accessibility compliance
- Activity Classification: Entry, conversion, error, process types
- Cycle Detection: Identifies repetitive user behavior patterns
- Process Variants: Common user journey paths
- Transition Analysis: Probability and duration metrics
- Automatic Insights: Generated recommendations and bottleneck detection
- Enhanced
ProcessMiningDatamodel with complete process structure - Activities dictionary with metadata (users, duration, success rates)
- Transitions dictionary with frequency and probability data
- Cycles and variants identification
- Statistical summaries and insights
- Hover tooltips with detailed metrics for activities and transitions
- Color-coded elements based on type (entry=green, error=red, etc.)
- Scalable node sizes based on activity frequency
- Dashed lines for cycle indicators
- Professional insights annotations
- Activity analysis with success rates and durations
- Top transitions ranked by frequency
- Detected cycles with impact assessment
- Process variants with success rates
- All tables optimized for dark theme
# User can configure:
- Min frequency threshold (1-100)
- Cycle detection (on/off)
- Layout algorithm (hierarchical/force/circular)
- Show frequencies on transitions (on/off)- Simple and complex process discovery
- Minimum frequency filtering
- Time window filtering
- Cycle detection accuracy
- Bottleneck detection insights
- Visualization creation and layouts
- Empty data handling
- Large dataset performance
- Memory efficiency
- Edge cases (single user, invalid data)
- End-to-end workflow integration
- All existing funnel analysis tests still passing
- Integration flow tests successful
- Basic scenarios and edge cases working
- Performance tests optimized
- Leverages existing
FunnelVisualizerinfrastructure - Extends
PathAnalyzerwith process mining capabilities - Integrates with existing color palette and typography systems
- Follows project's Polars-first philosophy with Pandas fallback
- Efficient graph algorithms using NetworkX
- Lazy evaluation for large datasets
- Smart caching of process discovery results
- Optimized layout calculations
- Professional error handling and data validation
- Type hints and comprehensive documentation
- Follows existing project patterns and standards
- Clean separation of concerns
- Hidden Pattern Detection - Automatically discovers actual user journeys vs intended funnels
- Bottleneck Identification - Finds where users get stuck or confused in the process
- Cycle Detection - Spots repetitive behaviors that may indicate UX problems
- Efficiency Analysis - Measures process performance and completion rates
- Process completion rates and timing analysis
- Most common user journey variants
- Problematic cycles and their impact
- Activity success rates and user engagement metrics
- Intuitive interface with progressive disclosure
- One-click process discovery and visualization
- Interactive exploration of process elements
- Export-ready professional visualizations
- Load data (sample, upload, or ClickHouse)
- Configure and run funnel analysis
- Navigate to 🔍 Process Mining tab
- Configure analysis parameters
- Click 🚀 Discover Process
- Explore interactive diagram and data tables
# Example process mining call:
process_data = path_analyzer.discover_process_mining_structure(
events_data,
min_frequency=5, # Hide low-frequency transitions
include_cycles=True, # Detect repetitive patterns
time_window_hours=168 # 7-day analysis window
)
# Create visualization:
fig = visualizer.create_process_mining_diagram(
process_data,
layout_algorithm="hierarchical", # Best for process flows
show_frequencies=True, # Display transition counts
show_statistics=True # Include activity metrics
)The process mining functionality is fully integrated and ready for production use. The implementation provides:
- ✅ Complete process discovery from user events
- ✅ Professional interactive visualizations
- ✅ Comprehensive insights and analytics
- ✅ Seamless integration with existing platform
- ✅ Full test coverage and performance optimization
The 🔍 Process Mining tab is now available in the Streamlit interface at http://localhost:8503 and provides powerful user journey analysis capabilities that complement the existing funnel analytics.