public class MultilayerPerceptronClassifier extends ProbabilisticClassifier<Vector,MultilayerPerceptronClassifier,MultilayerPerceptronClassificationModel> implements DefaultParamsWritable
Constructor and Description |
---|
MultilayerPerceptronClassifier() |
MultilayerPerceptronClassifier(String uid) |
Modifier and Type | Method and Description |
---|---|
static IntParam |
blockSize() |
IntParam |
blockSize()
Block size for stacking input data in matrices to speed up the computation.
|
static Params |
clear(Param<?> param) |
MultilayerPerceptronClassifier |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
static String |
explainParam(Param<?> param) |
static String |
explainParams() |
static ParamMap |
extractParamMap() |
static ParamMap |
extractParamMap(ParamMap extra) |
static Param<String> |
featuresCol() |
static M |
fit(Dataset<?> dataset) |
static M |
fit(Dataset<?> dataset,
ParamMap paramMap) |
static scala.collection.Seq<M> |
fit(Dataset<?> dataset,
ParamMap[] paramMaps) |
static M |
fit(Dataset<?> dataset,
ParamPair<?> firstParamPair,
ParamPair<?>... otherParamPairs) |
static M |
fit(Dataset<?> dataset,
ParamPair<?> firstParamPair,
scala.collection.Seq<ParamPair<?>> otherParamPairs) |
static <T> scala.Option<T> |
get(Param<T> param) |
static int |
getBlockSize() |
int |
getBlockSize() |
static <T> scala.Option<T> |
getDefault(Param<T> param) |
static String |
getFeaturesCol() |
static Vector |
getInitialWeights() |
Vector |
getInitialWeights() |
static String |
getLabelCol() |
static int[] |
getLayers() |
int[] |
getLayers() |
static int |
getMaxIter() |
static <T> T |
getOrDefault(Param<T> param) |
static Param<Object> |
getParam(String paramName) |
static String |
getPredictionCol() |
static String |
getProbabilityCol() |
static String |
getRawPredictionCol() |
static long |
getSeed() |
static String |
getSolver() |
static double |
getStepSize() |
static double[] |
getThresholds() |
static double |
getTol() |
static <T> boolean |
hasDefault(Param<T> param) |
static boolean |
hasParam(String paramName) |
static Param<Vector> |
initialWeights() |
Param<Vector> |
initialWeights()
The initial weights of the model.
|
static boolean |
isDefined(Param<?> param) |
static boolean |
isSet(Param<?> param) |
static Param<String> |
labelCol() |
static IntArrayParam |
layers() |
IntArrayParam |
layers()
Layer sizes including input size and output size.
|
static MultilayerPerceptronClassifier |
load(String path) |
static IntParam |
maxIter() |
static Param<?>[] |
params() |
static Param<String> |
predictionCol() |
static Param<String> |
probabilityCol() |
static Param<String> |
rawPredictionCol() |
static void |
save(String path) |
static LongParam |
seed() |
static <T> Params |
set(Param<T> param,
T value) |
MultilayerPerceptronClassifier |
setBlockSize(int value)
Sets the value of param
blockSize . |
static Learner |
setFeaturesCol(String value) |
MultilayerPerceptronClassifier |
setInitialWeights(Vector value)
Sets the value of param
initialWeights . |
static Learner |
setLabelCol(String value) |
MultilayerPerceptronClassifier |
setLayers(int[] value)
Sets the value of param
layers . |
MultilayerPerceptronClassifier |
setMaxIter(int value)
Set the maximum number of iterations.
|
static Learner |
setPredictionCol(String value) |
static E |
setProbabilityCol(String value) |
static E |
setRawPredictionCol(String value) |
MultilayerPerceptronClassifier |
setSeed(long value)
Set the seed for weights initialization if weights are not set
|
MultilayerPerceptronClassifier |
setSolver(String value)
Sets the value of param
solver . |
MultilayerPerceptronClassifier |
setStepSize(double value)
Sets the value of param
stepSize (applicable only for solver "gd"). |
static E |
setThresholds(double[] value) |
MultilayerPerceptronClassifier |
setTol(double value)
Set the convergence tolerance of iterations.
|
static Param<String> |
solver() |
Param<String> |
solver()
The solver algorithm for optimization.
|
static DoubleParam |
stepSize() |
static DoubleArrayParam |
thresholds() |
static DoubleParam |
tol() |
static String |
toString() |
static StructType |
transformSchema(StructType schema) |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
StructType |
validateAndTransformSchema(StructType schema,
boolean fitting,
DataType featuresDataType) |
StructType |
validateAndTransformSchema(StructType schema,
boolean fitting,
DataType featuresDataType)
Validates and transforms the input schema with the provided param map.
|
static MLWriter |
write() |
setProbabilityCol, setThresholds
setRawPredictionCol
fit, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRawPredictionCol, rawPredictionCol
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
getProbabilityCol, probabilityCol
getThresholds, thresholds
getMaxIter, maxIter
getStepSize, stepSize
write
save
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public MultilayerPerceptronClassifier(String uid)
public MultilayerPerceptronClassifier()
public static MultilayerPerceptronClassifier 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 M fit(Dataset<?> dataset, ParamPair<?> firstParamPair, scala.collection.Seq<ParamPair<?>> otherParamPairs)
public static M fit(Dataset<?> dataset, ParamPair<?> firstParamPair, ParamPair<?>... otherParamPairs)
public static final Param<String> labelCol()
public static final String getLabelCol()
public static final Param<String> featuresCol()
public static final String getFeaturesCol()
public static final Param<String> predictionCol()
public static final String getPredictionCol()
public static Learner setLabelCol(String value)
public static Learner setFeaturesCol(String value)
public static Learner setPredictionCol(String value)
public static M fit(Dataset<?> dataset)
public static StructType transformSchema(StructType schema)
public static final Param<String> rawPredictionCol()
public static final String getRawPredictionCol()
public static E setRawPredictionCol(String value)
public static final Param<String> probabilityCol()
public static final String getProbabilityCol()
public static final DoubleArrayParam thresholds()
public static double[] getThresholds()
public static E setProbabilityCol(String value)
public static E setThresholds(double[] value)
public static final LongParam seed()
public static final long getSeed()
public static final IntParam maxIter()
public static final int getMaxIter()
public static final DoubleParam tol()
public static final double getTol()
public static DoubleParam stepSize()
public static final double getStepSize()
public static final String getSolver()
public static final IntArrayParam layers()
public static final int[] getLayers()
public static final IntParam blockSize()
public static final int getBlockSize()
public static final Param<String> solver()
public static final Vector getInitialWeights()
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 MultilayerPerceptronClassifier setLayers(int[] value)
layers
.
value
- (undocumented)public MultilayerPerceptronClassifier setBlockSize(int value)
blockSize
.
Default is 128.
value
- (undocumented)public MultilayerPerceptronClassifier setSolver(String value)
solver
.
Default is "l-bfgs".
value
- (undocumented)public MultilayerPerceptronClassifier setMaxIter(int value)
value
- (undocumented)public MultilayerPerceptronClassifier setTol(double value)
value
- (undocumented)public MultilayerPerceptronClassifier setSeed(long value)
value
- (undocumented)public MultilayerPerceptronClassifier setInitialWeights(Vector value)
initialWeights
.
value
- (undocumented)public MultilayerPerceptronClassifier setStepSize(double value)
stepSize
(applicable only for solver "gd").
Default is 0.03.
value
- (undocumented)public MultilayerPerceptronClassifier copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Predictor<Vector,MultilayerPerceptronClassifier,MultilayerPerceptronClassificationModel>
extra
- (undocumented)public IntParam blockSize()
public int getBlockSize()
public Vector getInitialWeights()
public int[] getLayers()
public Param<Vector> initialWeights()
public IntArrayParam layers()
public Param<String> solver()
public StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
public StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
schema
- input schemafitting
- whether this is in fittingfeaturesDataType
- SQL DataType for FeaturesType.
E.g., VectorUDT
for vector features.