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 |
---|---|
static Params |
clear(Param<?> param)
Deprecated.
|
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)
|
static String |
explainParam(Param<?> param)
Deprecated.
|
static String |
explainParams()
Deprecated.
|
static ParamMap |
extractParamMap()
Deprecated.
|
static ParamMap |
extractParamMap(ParamMap extra)
Deprecated.
|
static <T> scala.Option<T> |
get(Param<T> param)
Deprecated.
|
static <T> scala.Option<T> |
getDefault(Param<T> param)
Deprecated.
|
boolean |
getDropLast()
Deprecated.
|
static String |
getInputCol()
Deprecated.
|
static <T> T |
getOrDefault(Param<T> param)
Deprecated.
|
static String |
getOutputCol()
Deprecated.
|
static Param<Object> |
getParam(String paramName)
Deprecated.
|
static <T> boolean |
hasDefault(Param<T> param)
Deprecated.
|
static boolean |
hasParam(String paramName)
Deprecated.
|
static Param<String> |
inputCol()
Deprecated.
|
static boolean |
isDefined(Param<?> param)
Deprecated.
|
static boolean |
isSet(Param<?> param)
Deprecated.
|
static OneHotEncoder |
load(String path)
Deprecated.
|
static Param<String> |
outputCol()
Deprecated.
|
static Param<?>[] |
params()
Deprecated.
|
static void |
save(String path)
Deprecated.
|
static <T> Params |
set(Param<T> param,
T value)
Deprecated.
|
OneHotEncoder |
setDropLast(boolean value)
Deprecated.
|
OneHotEncoder |
setInputCol(String value)
Deprecated.
|
OneHotEncoder |
setOutputCol(String value)
Deprecated.
|
static String |
toString()
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.
|
static MLWriter |
write()
Deprecated.
|
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 String toString()
public static Param<?>[] params()
public static String explainParam(Param<?> param)
public static String explainParams()
public static final boolean isSet(Param<?> param)
public static final boolean isDefined(Param<?> param)
public static boolean hasParam(String paramName)
public static Param<Object> getParam(String paramName)
public static final <T> scala.Option<T> get(Param<T> param)
public static final <T> T getOrDefault(Param<T> param)
public static final <T> scala.Option<T> getDefault(Param<T> param)
public static final <T> boolean hasDefault(Param<T> param)
public static final ParamMap extractParamMap()
public static final Param<String> inputCol()
public static final String getInputCol()
public static final Param<String> outputCol()
public static final String getOutputCol()
public static void save(String path) throws java.io.IOException
java.io.IOException
public static MLWriter write()
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)