Normalizer (Spark 4.2.0 JavaDoc)
- All Implemented Interfaces:
Serializable,org.apache.spark.internal.Logging,Params,HasInputCol,HasOutputCol,DefaultParamsWritable,Identifiable,MLWritable
Normalize a vector to have unit norm using the given p-norm.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter -
Constructor Summary
Constructors
-
Method Summary
doublegetP()p()Normalization in L^p^ space.
read()setP(double value) toString()Check transform validity and derive the output schema from the input schema.
uid()An immutable unique ID for the object and its derivatives.
Methods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContextMethods inherited from interface org.apache.spark.ml.util.MLWritable
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
-
Constructor Details
-
Normalizer
public Normalizer
(String uid) -
Normalizer
public Normalizer()
-
-
Method Details
-
load
-
read
-
uid
An immutable unique ID for the object and its derivatives.
- Specified by:
uidin interfaceIdentifiable- Returns:
- (undocumented)
-
p
Normalization in L^p^ space. Must be greater than equal to 1. (default: p = 2)
- Returns:
- (undocumented)
-
getP
public double getP()
-
setP
-
transformSchema
Check transform validity and derive the output schema from the input schema.
We check validity for interactions between parameters during
transformSchemaand raise an exception if any parameter value is invalid. Parameter value checks which do not depend on other parameters are handled byParam.validate().Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.
- Overrides:
transformSchemain classUnaryTransformer<Vector,Vector, Normalizer> - Parameters:
schema- (undocumented)- Returns:
- (undocumented)
-
toString
- Specified by:
toStringin interfaceIdentifiable- Overrides:
toStringin classObject
-