Calculates frame-based metrics from in-memory artwork_frame_analytics data for insertion into artwork_stats. These metrics are required by the database schema and the 15-metric benchmark system.
Usage
.comp_frame_metrics(frame_data, n_uniq_colors, n_strokes, draw_hrs)
calc_frame_metrics(
frame_analytics,
n_unique_colors,
brush_strokes,
drawing_hours
)Arguments
- frame_data
data.table. Frame analytics with unique_colors, technique_phase columns.
- n_uniq_colors
Integer. Total unique colors.
- n_strokes
Integer. Total brush strokes.
- draw_hrs
Numeric. Total drawing hours.
- frame_analytics
data.table. Output from create_frame_analytics() with columns: frame, unique_colors, technique_phase (minimum required)
- n_unique_colors
Integer. Total unique colors in the artwork
- brush_strokes
Integer. Total brush strokes in the artwork
- drawing_hours
Numeric. Total drawing hours
Value
List with 6 frame-based metrics: - strokes_per_unique_color: Numeric - color_generation_rate: Numeric - frame_color_variance: Numeric - frame_color_stability: Numeric - technique_phase_count: Integer - early_late_color_ratio: Numeric
List with 6 metrics
Details
## Simple Metrics: - `strokes_per_unique_color`: brush_strokes / n_unique_colors - `color_generation_rate`: n_unique_colors / drawing_hours
## Complex Metrics: - `frame_color_variance`: SD of unique_colors across frames - `frame_color_stability`: Frame - `technique_phase_count`: Max technique phase number - `early_late_color_ratio`: Colors in first 20
Functions
.comp_frame_metrics(): Pure computation - calculate aggregate frame metricscalc_frame_metrics(): Calculate frame-based aggregate metrics
See also
Other pipeline functions:
build-record,
commit_artwork(),
createArtworkHash,
create_gallery_images(),
frame-analytics,
render_certificate(),
validate_table_list()
