public final class QuantileDiscretizer extends Estimator<Bucketizer>
QuantileDiscretizer
takes a column with continuous features and outputs a column with binned
categorical features. The bin ranges are chosen by taking a sample of the data and dividing it
into roughly equal parts. The lower and upper bin bounds will be -Infinity and +Infinity,
covering all real values. This attempts to find numBuckets partitions based on a sample of data,
but it may find fewer depending on the data sample values.Constructor and Description |
---|
QuantileDiscretizer() |
QuantileDiscretizer(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
QuantileDiscretizer |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
Bucketizer |
fit(DataFrame dataset)
Fits a model to the input data.
|
int |
getNumBuckets() |
static QuantileDiscretizer |
load(java.lang.String path) |
static int |
minSamplesRequired() |
IntParam |
numBuckets()
Maximum number of buckets (quantiles, or categories) into which data points are grouped.
|
QuantileDiscretizer |
setInputCol(java.lang.String value) |
QuantileDiscretizer |
setNumBuckets(int value) |
QuantileDiscretizer |
setOutputCol(java.lang.String value) |
QuantileDiscretizer |
setSeed(long value) |
StructType |
transformSchema(StructType schema)
:: DeveloperApi ::
|
java.lang.String |
uid()
An immutable unique ID for the object and its derivatives.
|
transformSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn, validateParams
toString
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public QuantileDiscretizer(java.lang.String uid)
public QuantileDiscretizer()
public static int minSamplesRequired()
public static QuantileDiscretizer load(java.lang.String path)
public java.lang.String uid()
Identifiable
uid
in interface Identifiable
public QuantileDiscretizer setNumBuckets(int value)
public QuantileDiscretizer setInputCol(java.lang.String value)
public QuantileDiscretizer setOutputCol(java.lang.String value)
public QuantileDiscretizer setSeed(long value)
public StructType transformSchema(StructType schema)
PipelineStage
Derives the output schema from the input schema.
transformSchema
in class PipelineStage
schema
- (undocumented)public Bucketizer fit(DataFrame dataset)
Estimator
fit
in class Estimator<Bucketizer>
dataset
- (undocumented)public QuantileDiscretizer copy(ParamMap extra)
Params
copy
in interface Params
copy
in class Estimator<Bucketizer>
extra
- (undocumented)defaultCopy()
public IntParam numBuckets()
public int getNumBuckets()