Commit graph

3 commits

Author SHA1 Message Date
2450159fe9 feat(site-finder): per-competitor relevance_weight (#949 PR B)
Adds deterministic horizon-aware relevance_weight ∈[0,1] to get_competitors
(ТЗ §9.1): weighted mean of geo_proximity (0.30), class_similarity (0.25),
price_similarity (0.20), stage_at_horizon (0.25). stage_at_horizon projects
each competitor's sell-out to horizon_months (request param, default 12) so a
competitor sold-out by our launch ranks lower. class_similarity uses a domrf
class-ladder vs the local dominant class (no target class yet). Orders by
relevance_weight DESC (distance still present + tie-break). relevance_breakdown
(4 sub-scores) exposed for explainability (§16).

Additive: all legacy Competitor fields intact, new fields Optional; zero
frontend consumers of /competitors (UI uses /analyze). sold-count folded into
existing price query (no extra db.execute, #227 regression green). Graceful:
thin data → neutral 0.5. 57 new pure-helper tests. Completes #949.
2026-06-03 00:45:28 +05:00
lekss361
31581cedd2 fix(#112): remove broken status='sold' filter from competitors avg_price query
domrf_kn_flats.status is NULL in ~99.8% of rows, so WHERE status='sold'
always returned 0 rows and avg_price_per_m2 was always None. Drop the
filter; AVG over all rows with price_per_m2 IS NOT NULL is semantically
correct for a complex-level price estimate.

Adds regression test test_competitors_avg_price_populated (Issue #227).
2026-05-16 22:46:10 +03:00
e561df1b55 feat(parcels): competitors endpoint (Forgejo #112 Phase 1 backend) (#191)
Some checks failed
CI / backend (push) Successful in 1m16s
Deploy / changes (push) Successful in 6s
Deploy / build-backend (push) Failing after 12s
Deploy / build-worker (push) Failing after 12s
Deploy / build-frontend (push) Failing after 0s
Deploy / deploy (push) Failing after 0s
CI / frontend (push) Successful in 2m17s
2026-05-15 22:21:05 +00:00