public class MultilayerPerceptronClassifier extends Predictor<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() |
Param<String> |
featuresCol()
Param for features column name.
|
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() |
String |
getFeaturesCol() |
static Vector |
getInitialWeights() |
Vector |
getInitialWeights() |
static String |
getLabelCol() |
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() |
String |
getPredictionCol() |
static long |
getSeed() |
static String |
getSolver() |
String |
getSolver() |
static double |
getStepSize() |
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() |
Param<String> |
labelCol()
Param for label column name.
|
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() |
Param<String> |
predictionCol()
Param for prediction column name.
|
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) |
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"). |
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 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)
Validates and transforms the input schema with the provided param map.
|
static void |
validateParams() |
static MLWriter |
write() |
fit, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
save
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
public MultilayerPerceptronClassifier(String uid)
public MultilayerPerceptronClassifier()
public static MultilayerPerceptronClassifier load(String path)
public static String toString()
public static Param<?>[] params()
public static void validateParams()
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 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 final DoubleParam stepSize()
public static final double getStepSize()
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 String getSolver()
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 IntArrayParam layers()
public int[] getLayers()
public IntParam blockSize()
public int getBlockSize()
public Param<String> solver()
public String getSolver()
public Param<Vector> initialWeights()
public Vector getInitialWeights()
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.public Param<String> labelCol()
public String getLabelCol()
public Param<String> featuresCol()
public String getFeaturesCol()
public Param<String> predictionCol()
public String getPredictionCol()