public class NaiveBayes extends ProbabilisticClassifier<Vector,NaiveBayes,NaiveBayesModel> implements NaiveBayesParams, DefaultParamsWritable
Constructor and Description |
---|
NaiveBayes() |
NaiveBayes(String uid) |
Modifier and Type | Method and Description |
---|---|
NaiveBayes |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
static NaiveBayes |
load(String path) |
Param<String> |
modelType()
The model type which is a string (case-sensitive).
|
static MLReader<T> |
read() |
NaiveBayes |
setModelType(String value)
Set the model type using a string (case-sensitive).
|
NaiveBayes |
setSmoothing(double value)
Set the smoothing parameter.
|
NaiveBayes |
setWeightCol(String value)
Sets the value of param
weightCol . |
DoubleParam |
smoothing()
The smoothing parameter.
|
String |
uid()
An immutable unique ID for the object and its derivatives.
|
Param<String> |
weightCol()
Param for weight column name.
|
probabilityCol, setProbabilityCol, setThresholds, thresholds
rawPredictionCol, setRawPredictionCol
featuresCol, fit, labelCol, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
params
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModelType, getSmoothing
validateAndTransformSchema
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
getWeightCol
write
save
validateAndTransformSchema
getRawPredictionCol, rawPredictionCol
getProbabilityCol
getThresholds
$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitialize
public static NaiveBayes load(String path)
public static MLReader<T> read()
public final DoubleParam smoothing()
NaiveBayesParams
smoothing
in interface NaiveBayesParams
public final Param<String> modelType()
NaiveBayesParams
modelType
in interface NaiveBayesParams
public final Param<String> weightCol()
HasWeightCol
weightCol
in interface HasWeightCol
public String uid()
Identifiable
uid
in interface Identifiable
public NaiveBayes setSmoothing(double value)
value
- (undocumented)public NaiveBayes setModelType(String value)
value
- (undocumented)public NaiveBayes setWeightCol(String value)
weightCol
.
If this is not set or empty, we treat all instance weights as 1.0.
Default is not set, so all instances have weight one.
value
- (undocumented)public NaiveBayes copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Predictor<Vector,NaiveBayes,NaiveBayesModel>
extra
- (undocumented)