Analyzer¶
Statistical analysis utilities for ASCI results.
Class Reference¶
Analyzer ¶
Analyzer for ASCI results
Functions¶
__init__(results_df, config) ¶
Initialize analyzer
| PARAMETER | DESCRIPTION |
|---|---|
results_df | ASCI calculation results TYPE: |
config | Reaction configuration TYPE: |
get_top_catalysts(n=10, metric='ASCI') ¶
Get top N catalysts by specified metric
| PARAMETER | DESCRIPTION |
|---|---|
n | Number of catalysts TYPE: |
metric | Metric to rank by ('ASCI', 'activity_score', etc.) TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
DataFrame | Top N catalysts |
get_pareto_optimal() ¶
Get Pareto optimal catalysts
| RETURNS | DESCRIPTION |
|---|---|
DataFrame | Pareto optimal catalysts |
filter_by_threshold(metric, threshold, greater_than=True) ¶
Filter catalysts by threshold
| PARAMETER | DESCRIPTION |
|---|---|
metric | Metric to filter by TYPE: |
threshold | Threshold value TYPE: |
greater_than | If True, keep values > threshold TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
DataFrame | Filtered catalysts |
get_statistics_by_element() ¶
Get statistics grouped by element
| RETURNS | DESCRIPTION |
|---|---|
dict | Statistics by element |
get_correlation_analysis() ¶
Get correlation matrix of key metrics
| RETURNS | DESCRIPTION |
|---|---|
DataFrame | Correlation matrix |
compare_weight_scenarios(weight_scenarios) ¶
Compare different weight scenarios
| PARAMETER | DESCRIPTION |
|---|---|
weight_scenarios | List of (w_a, w_s, w_c) weight combinations TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
DataFrame | Comparison results |
export_summary(output_path) ¶
Export comprehensive summary
| PARAMETER | DESCRIPTION |
|---|---|
output_path | Output file path TYPE: |
Quick Reference¶
from ascicat.analyzer import Analyzer
analyzer = Analyzer(results, config)
# Basic statistics
stats = analyzer.get_statistics()
# Correlation analysis
corr = analyzer.compute_correlations()
# Distribution analysis
dist = analyzer.analyze_distribution()
Initialization¶
analyzer = Analyzer(
results, # DataFrame from calculate_asci()
config # ReactionConfig (optional)
)
Methods¶
get_statistics¶
Get summary statistics for all scores.
Returns: Nested dictionary with mean, std, min, max, median for each score.
compute_correlations¶
Compute correlations between scores.
Returns: DataFrame with Pearson correlations.
analyze_distribution¶
Analyze ASCI score distribution.
dist = analyzer.analyze_distribution()
print(f"Skewness: {dist['skewness']}")
print(f"Kurtosis: {dist['kurtosis']}")
Returns: Dictionary with distribution metrics.
identify_outliers¶
Find outlier catalysts.
outliers = analyzer.identify_outliers(method='iqr', threshold=1.5)
print(f"Found {len(outliers)} outliers")
compare_groups¶
Compare catalyst groups.
Example Usage¶
from ascicat import ASCICalculator
from ascicat.analyzer import Analyzer
# Calculate ASCI
calc = ASCICalculator(reaction='HER')
calc.load_data('data/HER_clean.csv')
results = calc.calculate_asci()
# Analyze
analyzer = Analyzer(results, calc.config)
# Statistics
stats = analyzer.get_statistics()
print(f"ASCI: {stats['asci']['mean']:.3f} ± {stats['asci']['std']:.3f}")
# Correlations
corr = analyzer.compute_correlations()
print("\nScore Correlations:")
print(corr)
# Distribution
dist = analyzer.analyze_distribution()
print(f"\nSkewness: {dist['skewness']:.3f}")