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, thresholdsrawPredictionCol, setRawPredictionColfeaturesCol, fit, labelCol, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchemaparamsequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetModelType, getSmoothingvalidateAndTransformSchemagetLabelCol, labelColfeaturesCol, getFeaturesColgetPredictionCol, predictionColclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwntoStringgetWeightColwritesavevalidateAndTransformSchemagetRawPredictionCol, rawPredictionColgetProbabilityColgetThresholds$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_, uninitializepublic static NaiveBayes load(String path)
public static MLReader<T> read()
public final DoubleParam smoothing()
NaiveBayesParamssmoothing in interface NaiveBayesParamspublic final Param<String> modelType()
NaiveBayesParamsmodelType in interface NaiveBayesParamspublic final Param<String> weightCol()
HasWeightColweightCol in interface HasWeightColpublic String uid()
Identifiableuid in interface Identifiablepublic 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)
ParamsdefaultCopy().copy in interface Paramscopy in class Predictor<Vector,NaiveBayes,NaiveBayesModel>extra - (undocumented)