diff options
author | Yuri Gorshenin <y@maps.me> | 2016-04-08 18:21:06 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2016-04-08 18:21:06 +0300 |
commit | 1ba5f9384ec4dbfca964709c9c42802ecbbcae90 (patch) | |
tree | 679913d4105f89feb09e1761763c3aa93d247c47 /search/search_quality | |
parent | caf5c30acaab477c910047c867636baa71cb821b (diff) |
[search] Fixed linear model.
Diffstat (limited to 'search/search_quality')
-rw-r--r-- | search/search_quality/sample.cpp | 2 | ||||
-rwxr-xr-x | search/search_quality/scoring_model.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/search/search_quality/sample.cpp b/search/search_quality/sample.cpp index 9528ad63d2..cba293c7b0 100644 --- a/search/search_quality/sample.cpp +++ b/search/search_quality/sample.cpp @@ -194,7 +194,7 @@ string DebugPrint(Sample::Result const & r) oss << "relevance: " << DebugPrint(r.m_relevance) << " "; oss << "name: " << DebugPrint(r.m_name) << " "; oss << "house number: " << r.m_houseNumber << " "; - oss << "pos: " << r.m_pos << " "; + oss << "pos: " << DebugPrint(r.m_pos) << " "; oss << "types: ["; for (size_t i = 0; i < r.m_types.size(); ++i) { diff --git a/search/search_quality/scoring_model.py b/search/search_quality/scoring_model.py index 9c5e8d394c..b22b241e3b 100755 --- a/search/search_quality/scoring_model.py +++ b/search/search_quality/scoring_model.py @@ -11,7 +11,7 @@ import sys FEATURES = ['DistanceToPivot', 'Rank', 'NameScore', 'NameCoverage', 'SearchType'] -DISTANCE_WINDOW = 1e9 +MAX_DISTANCE_METERS = 2e7 MAX_RANK = 255 RELEVANCES = {'Irrelevant': 0, 'Relevant': 1, 'Vital': 3} NAME_SCORES = ['Zero', 'Substring Prefix', 'Substring', 'Full Match Prefix', 'Full Match'] @@ -26,7 +26,7 @@ SEARCH_TYPES = {'POI': 0, def normalize_data(data): - transform_distance = lambda d: exp(- d * 1000 / DISTANCE_WINDOW) + transform_distance = lambda d: 1 - min(d, MAX_DISTANCE_METERS) / MAX_DISTANCE_METERS max_name_score = len(NAME_SCORES) - 1 max_search_type = SEARCH_TYPES['COUNTRY'] |