StringIndexerBase (Spark 4.2.0 JavaDoc)
- All Superinterfaces:
HasHandleInvalid,HasInputCol,HasInputCols,HasOutputCol,HasOutputCols,Identifiable,Params,Serializable
- All Known Implementing Classes:
StringIndexer,StringIndexerModel
-
Method Summary
Returns the input and output column names corresponding in pair.
Param for how to handle invalid data (unseen labels or NULL values).
Param for how to order labels of string column.
Validates and transforms the input schema.
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copy, 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
-
Method Details
-
getInOutCols
Returns the input and output column names corresponding in pair.
-
getStringOrderType
String getStringOrderType()
-
handleInvalid
Param for how to handle invalid data (unseen labels or NULL values). Options are 'skip' (filter out rows with invalid data), 'error' (throw an error), or 'keep' (put invalid data in a special additional bucket, at index numLabels). Default: "error"
- Specified by:
handleInvalidin interfaceHasHandleInvalid- Returns:
- (undocumented)
-
stringOrderType
Param for how to order labels of string column. The first label after ordering is assigned an index of 0. Options are: - 'frequencyDesc': descending order by label frequency (most frequent label assigned 0) - 'frequencyAsc': ascending order by label frequency (least frequent label assigned 0) - 'alphabetDesc': descending alphabetical order - 'alphabetAsc': ascending alphabetical order Default is 'frequencyDesc'.
Note: In case of equal frequency when under frequencyDesc/Asc, the strings are further sorted alphabetically.
- Returns:
- (undocumented)
-
validateAndTransformField
-
validateAndTransformSchema
StructType validateAndTransformSchema
(StructType schema, boolean skipNonExistsCol) Validates and transforms the input schema.
-