Changes between Version 3 and Version 4 of ComponentCompatibilitySuccessRate


Ignore:
Timestamp:
01/29/26 16:50:20 (10 days ago)
Author:
233194
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ComponentCompatibilitySuccessRate

    v3 v4  
    7777{{{
    7878cpu_mobo_pairs =
    79   π_{cpu.brand ⇒ cpu_brand, cpu.name ⇒ cpu_model,
     79  π_{cpu_comp.brand ⇒ cpu_brand,
     80     cpu_comp.name ⇒ cpu_model,
    8081     mobo.chipset ⇒ motherboard_chipset,
    81      b.id ⇒ build_id
     82     b.id ⇒ build_id,
     83     b.user_id,
     84     b.created_at
    8285  } (
    83     σ_{c1.type = 'CPU' AND c2.type = 'Motherboard'} (
     86    σ_{b.is_approved = TRUE} (
    8487      build b
    85       ⋈_{b.id = bc1.build_id} build_component bc1
    86       ⋈_{bc1.component_id = c1.id} components c1
    87       ⋈_{b.id = bc2.build_id} build_component bc2
    88       ⋈_{bc2.component_id = c2.id} components c2
     88      ⋈_{b.id = bc_cpu.build_id} build_component bc_cpu
     89      ⋈_{bc_cpu.component_id = cpu_comp.id} components cpu_comp
     90      ⋈_{cpu.component_id = cpu_comp.id} cpu
     91      ⋈_{b.id = bc_mobo.build_id} build_component bc_mobo
     92      ⋈_{bc_mobo.component_id = mobo_comp.id} components mobo_comp
     93      ⋈_{mobo.component_id = mobo_comp.id} motherboard mobo
    8994    )
    9095  )
    9196
     97recent_activity =
     98  π_{DISTINCT build_id} (
     99    σ_{created_at ≥ CURRENT_DATE - INTERVAL '3 months'} (review)
     100  )
     101
    92102pair_metrics =
    93   γ_{cpu_brand, cpu_model, motherboard_chipset;
    94      COUNT(build_id) ⇒ total_builds,
    95      AVG(rb.value) ⇒ avg_satisfaction,
    96      COUNT(DISTINCT ub.user_id WHERE ub.still_active = TRUE) ⇒ active_builds
     103  γ_{cmp.cpu_brand, cmp.cpu_model, cmp.motherboard_chipset;
     104     COUNT(DISTINCT cmp.build_id) ⇒ total_builds,
     105     AVG(COALESCE(rb.value, 0)) ⇒ avg_satisfaction,
     106     COUNT(DISTINCT ra.build_id) ⇒ active_builds
    97107  } (
    98108    cpu_mobo_pairs cmp
    99     _{cmp.build_id = rb.build_id} rating_build rb
    100     ⋈_{cmp.build_id = ub.build_id} user_builds ub
     109    _{cmp.build_id = rb.build_id} rating_build rb
     110    ⟕_{cmp.build_id = ra.build_id} recent_activity ra
    101111  )
     112  WHERE total_builds ≥ 2
    102113
    103 λ_12 (
     114λ_15 (
    104115  τ_{success_rate DESC, total_builds DESC} (
    105     σ_{total_builds ≥ 10} (
    106       π_{pm.cpu_brand + ' ' + pm.cpu_model ⇒ cpu_combo,
    107          pm.motherboard_chipset,
    108          pm.total_builds,
    109          ROUND(pm.avg_satisfaction, 2) ⇒ avg_satisfaction,
    110          ROUND((pm.avg_satisfaction / 5.0) * 0.6 + (pm.active_builds / pm.total_builds) * 0.4, 3) ⇒ success_rate
    111       } (pair_metrics pm)
    112     )
     116    π_{CONCAT(pm.cpu_brand, ' ', pm.cpu_model) ⇒ cpu_combo,
     117       pm.motherboard_chipset,
     118       pm.total_builds,
     119       ROUND(pm.avg_satisfaction, 2) ⇒ avg_satisfaction,
     120       ROUND((pm.avg_satisfaction / 5.0) * 0.6 + (pm.active_builds / pm.total_builds) * 0.4, 3) ⇒ success_rate
     121    } (pair_metrics pm)
    113122  )
    114123)