blob: d5ee955af49561d9aaade4a36ba2c43f0714b4a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#pragma once
#include "search/pre_ranking_info.hpp"
#include "search/ranking_utils.hpp"
#include "search/search_model.hpp"
#include "std/iostream.hpp"
class FeatureType;
namespace search
{
struct RankingInfo
{
static double const kMaxDistMeters;
// Distance from the feature to the pivot point.
double m_distanceToPivot = kMaxDistMeters;
// Rank of the feature.
uint8_t m_rank = 0;
// Score for the feature's name.
NameScore m_nameScore = NAME_SCORE_ZERO;
// Search type for the feature.
SearchModel::SearchType m_searchType = SearchModel::SEARCH_TYPE_COUNT;
// True if all of the tokens that the feature was matched by
// correspond to this feature's categories.
bool m_pureCats = false;
// True if none of the tokens that the feature was matched by
// corresponds to this feature's categories although all of the
// tokens are categorial ones.
bool m_falseCats = false;
static void PrintCSVHeader(ostream & os);
void ToCSV(ostream & os) const;
// Returns rank calculated by a linear model. Large values
// correspond to important features.
double GetLinearModelRank() const;
};
string DebugPrint(RankingInfo const & info);
} // namespace search
|