<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
<br>
</div></div>Actually, you're doing something slightly unusual there: making the internal member public. Protected would be better, and private is I think most usual; library clients aren't going to have access to the Internal class declaration, so they can't call things on it. This means it's actually difficult right now to subclass Feature.<br>
<br>
I don't think we should worry about this with LTR right now, but I suspect a better approach is to pass the FeatureList (as a helper) to Feature::get_values(), or set it when we add the Feature to FeatureList, and use that to ask for things like the current query, current document, normalised lengths &c.<br></blockquote><div><br></div><div>I see. What I've put in Feature::Internal can actually be part of FeatureList class (maybe as FeatureList::Internal). For the time being, I'll at least make the internal member in Feature as protected, and we can take this up later when we are getting rid of Letor class and putting everything under Ranker.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It's possible that we could also do the thing Weight does, and have each Feature report which statistics it needs, so FeatureList can calculate them each once in advance before calling get_values() on all its Feature objects. (Weight objects I think get the statistics poked onto them, but<br></blockquote><div><br></div><div>This is a good idea.</div><div>(words after "but" are somehow missing, could you please resend?)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
J<br>
<br>
</font></span></blockquote></div>--<div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"></div></div></div></div></div></div></div></div></div>
</div><div class="gmail_extra">Ayush</div></div>