Package org.apache.solr.ltr.norm
Class StandardNormalizer
- java.lang.Object
-
- org.apache.solr.ltr.norm.Normalizer
-
- org.apache.solr.ltr.norm.StandardNormalizer
-
public class StandardNormalizer extends Normalizer
A Normalizer to scale a feature value around an average-and-standard-deviation distribution.Example configuration:
"norm" : { "class" : "org.apache.solr.ltr.norm.StandardNormalizer", "params" : { "avg":"42", "std":"6" } }
Example normalizations:
- 39 will be normalized to -0.5
- 42 will be normalized to 0
- 45 will be normalized to +0.5
-
-
Constructor Summary
Constructors Constructor Description StandardNormalizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getAvg()
float
getStd()
float
normalize(float value)
LinkedHashMap<String,Object>
paramsToMap()
void
setAvg(float avg)
void
setAvg(String avg)
void
setStd(float std)
void
setStd(String std)
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
-
getAvg
public float getAvg()
-
setAvg
public void setAvg(float avg)
-
getStd
public float getStd()
-
setStd
public void setStd(float std)
-
setAvg
public void setAvg(String avg)
-
setStd
public void setStd(String std)
-
normalize
public float normalize(float value)
- Specified by:
normalize
in classNormalizer
-
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
-
paramsToMap
public LinkedHashMap<String,Object> paramsToMap()
- Specified by:
paramsToMap
in classNormalizer
-
-