Skip to content

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: DataFrame

config

Reaction configuration

TYPE: ReactionConfig

get_top_catalysts(n=10, metric='ASCI')

Get top N catalysts by specified metric

PARAMETER DESCRIPTION
n

Number of catalysts

TYPE: int DEFAULT: 10

metric

Metric to rank by ('ASCI', 'activity_score', etc.)

TYPE: str DEFAULT: 'ASCI'

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: str

threshold

Threshold value

TYPE: float

greater_than

If True, keep values > threshold

TYPE: bool DEFAULT: True

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: list of tuples

RETURNS DESCRIPTION
DataFrame

Comparison results

export_summary(output_path)

Export comprehensive summary

PARAMETER DESCRIPTION
output_path

Output file path

TYPE: str

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.

stats = analyzer.get_statistics()
print(stats['asci']['mean'])
print(stats['activity']['std'])

Returns: Nested dictionary with mean, std, min, max, median for each score.

compute_correlations

Compute correlations between scores.

corr_matrix = analyzer.compute_correlations()
print(corr_matrix)

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.

comparison = analyzer.compare_groups(
    group_col='Ametal',
    metric='ASCI'
)

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}")