fix: remove hidden score modifiers + fix Zürich auto-inference false positive
Score formula simplified to: finalScore = round(hard×60% + soft×40%) Removes dataQualityModifier, confidenceModifier, mustHaveEval.scoreImpact — the breakdown panel now always matches the displayed score. Also removes 'industrie groove' from Zürich-only location signals — the phrase describes an aesthetic preference, not a district reference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -584,17 +584,8 @@ export function calculateScore(need: Need, property: Property): MatchEngineOutpu
|
||||
]
|
||||
const mustHaveEval = scoreMustHaves(allMustHaveText, property)
|
||||
|
||||
// ── Modifiers: data quality and confidence adjust the final score ─────────
|
||||
// These are intentionally applied after the hard/soft weighted sum so that
|
||||
// a low-confidence or poor-data property can be penalised without distorting
|
||||
// the individual criterion breakdown.
|
||||
const dataQualityModifier = calcDataQualityModifier(property)
|
||||
const confidenceModifier = calcConfidenceModifier(property)
|
||||
|
||||
// ── Final score: hard/soft weighted sum + must-have penalty + modifiers ───
|
||||
const baseScore = hardMatchScore * 0.60 + softFactorScore * 0.40
|
||||
const rawFinal = baseScore - hardFilter.severePenalty + mustHaveEval.scoreImpact
|
||||
+ dataQualityModifier + confidenceModifier
|
||||
// ── Final score: hard/soft weighted sum, clamped 0–100 ───────────────────
|
||||
const rawFinal = hardMatchScore * 0.60 + softFactorScore * 0.40 - hardFilter.severePenalty
|
||||
const finalScore = Math.round(Math.min(100, Math.max(0, rawFinal)))
|
||||
|
||||
// ── Factor classification — only use weighted soft factors for positive/negative ──
|
||||
@@ -622,8 +613,8 @@ export function calculateScore(need: Need, property: Property): MatchEngineOutpu
|
||||
finalScore,
|
||||
hardMatchScore,
|
||||
softFactorScore,
|
||||
dataQualityModifier,
|
||||
confidenceModifier,
|
||||
dataQualityModifier: 0,
|
||||
confidenceModifier: 0,
|
||||
positiveFactors,
|
||||
negativeFactors,
|
||||
allHardFactors: hardFactors,
|
||||
|
||||
@@ -60,8 +60,7 @@ export function mockParseNeed(input: string): ParseNeedResult {
|
||||
|
||||
// Contextual Zürich inference: only truly Zürich-specific place/brand names
|
||||
const ZURICH_ONLY_SIGNALS = [
|
||||
'industrie groove', 'industrie-groove',
|
||||
'pfingstweidstrasse', 'hardbrücke', 'freilager', 'europaallee',
|
||||
'pfingstweidstrasse', 'freilager', 'europaallee',
|
||||
'zürich-west', 'zürich west', 'zürich nord', 'zürich süd',
|
||||
'hürlimann', 'viadukt', 'schiffbau',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user