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 FormConstructor 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, transform
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputCol, inputCol
getOutputCol, outputCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
write
save
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public OneHotEncoder(String uid)
public OneHotEncoder()
public static OneHotEncoder load(String path)
public static MLReader<T> read()
public String uid()
Identifiable
uid
in interface Identifiable
public 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)
PipelineStage
Check 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 PipelineStage
schema
- (undocumented)public Dataset<Row> transform(Dataset<?> dataset)
Transformer
transform
in class Transformer
dataset
- (undocumented)public OneHotEncoder copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Transformer
extra
- (undocumented)