OneHotEncoderEstimator will be renamed OneHotEncoder and this OneHotEncoder
will be removed in 3.0.0.public class OneHotEncoder extends Transformer implements HasInputCol, HasOutputCol, DefaultParamsWritable
[0.0, 0.0, 1.0, 0.0].
The last category is not included by default (configurable via OneHotEncoder!.dropLast
because it makes the vector entries sum up to one, and hence linearly dependent.
So an input value of 4.0 maps to [0.0, 0.0, 0.0, 0.0].
StringIndexer for converting categorical values into category indices,
Serialized Form| Constructor and Description |
|---|
OneHotEncoder()
Deprecated.
|
OneHotEncoder(String uid)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
OneHotEncoder |
copy(ParamMap extra)
Deprecated.
Creates a copy of this instance with the same UID and some extra params.
|
BooleanParam |
dropLast()
Deprecated.
Whether to drop the last category in the encoded vector (default: true)
|
boolean |
getDropLast()
Deprecated.
|
static OneHotEncoder |
load(String path)
Deprecated.
|
static MLReader<T> |
read()
Deprecated.
|
OneHotEncoder |
setDropLast(boolean value)
Deprecated.
|
OneHotEncoder |
setInputCol(String value)
Deprecated.
|
OneHotEncoder |
setOutputCol(String value)
Deprecated.
|
Dataset<Row> |
transform(Dataset<?> dataset)
Deprecated.
Transforms the input dataset.
|
StructType |
transformSchema(StructType schema)
Deprecated.
:: DeveloperApi ::
|
String |
uid()
Deprecated.
An immutable unique ID for the object and its derivatives.
|
transform, transform, transformequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputCol, inputColgetOutputCol, outputColclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwntoStringwritesaveinitializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic OneHotEncoder(String uid)
public OneHotEncoder()
public static OneHotEncoder load(String path)
public static MLReader<T> read()
public String uid()
Identifiableuid in interface Identifiablepublic final BooleanParam dropLast()
public boolean getDropLast()
public OneHotEncoder setDropLast(boolean value)
public OneHotEncoder setInputCol(String value)
public OneHotEncoder setOutputCol(String value)
public StructType transformSchema(StructType schema)
PipelineStageCheck transform validity and derive the output schema from the input schema.
We check validity for interactions between parameters during transformSchema and
raise an exception if any parameter value is invalid. Parameter value checks which
do not depend on other parameters are handled by Param.validate().
Typical implementation should first conduct verification on schema change and parameter validity, including complex parameter interaction checks.
transformSchema in class PipelineStageschema - (undocumented)public Dataset<Row> transform(Dataset<?> dataset)
Transformertransform in class Transformerdataset - (undocumented)public OneHotEncoder copy(ParamMap extra)
ParamsdefaultCopy().copy in interface Paramscopy in class Transformerextra - (undocumented)