Hi Kamal, You can use a MinMaxNormalizer[1], and get min and max from historical data, for the original score won't guarantee that the value will be **always** between 0..1 but it should happen in the majority of the cases, if the 0..1 constraint is not super strong I would rather use a StandardNormalizer[2].
For the value at -1, at the moment there is no way to assign a default value to a feature, but It is something that I'm planning to contribute, you might achieve that by playing with the default value of the field in the schema. If you can, could you please explain why you need to normalize only two fields? what are you trying to do? Cheers, Diego [1] https://lucene.apache.org/solr/6_6_0//solr-ltr/org/apache/solr/ltr/norm/MinMaxNormalizer.html [2] https://lucene.apache.org/solr/6_6_0//solr-ltr/org/apache/solr/ltr/norm/StandardNormalizer.html From: solr-user@lucene.apache.org At: 04/18/19 21:13:14To: solr-user@lucene.apache.org Subject: LTR: Normalize Feature Weights Hi, Is there a way to normalize the value of fieldValueFeature and OriginalScoreFeature features within some range i.e 0-1. Lets suppose I have 4 products with some field values, I wish to normalize weight within 0 and 1 using func (val-min)/(max-min). Product FieldValue Normalized Value P1 4 1 P2 3 0.6 P3 2 0.3 P4 1 0 P5 - -1 If the product does not contain the field value, make feature value as -1 (some static). I tried to use the scale function, but since scale function works on the whole index, so it will not be relevant for our case. If you multiple function here, performance will be impacted. I have seen solr ltr source code and there is a normalized function, but not sure how to implement it in our case. Regards Kamal