Package org.apache.solr.ltr.norm
Class MinMaxNormalizer
- java.lang.Object
-
- org.apache.solr.ltr.norm.Normalizer
-
- org.apache.solr.ltr.norm.MinMaxNormalizer
-
public class MinMaxNormalizer extends Normalizer
A Normalizer to scale a feature value using a (min,max) range.Example configuration:
"norm" : { "class" : "org.apache.solr.ltr.norm.MinMaxNormalizer", "params" : { "min":"0", "max":"50" } }
Example normalizations:- -5 will be normalized to -0.1
- 55 will be normalized to 1.1
- +5 will be normalized to +0.1
-
-
Constructor Summary
Constructors Constructor Description MinMaxNormalizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getMax()
float
getMin()
float
normalize(float value)
LinkedHashMap<String,Object>
paramsToMap()
void
setMax(float max)
void
setMax(String max)
void
setMin(float min)
void
setMin(String min)
String
toString()
protected void
validate()
As part of creation of a normalizer instance, this function confirms that the normalizer parameters are valid.-
Methods inherited from class org.apache.solr.ltr.norm.Normalizer
explain, getInstance
-
-
-
-
Method Detail
-
getMin
public float getMin()
-
setMin
public void setMin(float min)
-
setMin
public void setMin(String min)
-
getMax
public float getMax()
-
setMax
public void setMax(float max)
-
setMax
public void setMax(String max)
-
validate
protected void validate() throws NormalizerException
Description copied from class:Normalizer
As part of creation of a normalizer instance, this function confirms that the normalizer parameters are valid.- Specified by:
validate
in classNormalizer
- Throws:
NormalizerException
- Normalizer Exception
-
normalize
public float normalize(float value)
- Specified by:
normalize
in classNormalizer
-
paramsToMap
public LinkedHashMap<String,Object> paramsToMap()
- Specified by:
paramsToMap
in classNormalizer
-
-