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) |
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 . |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
setProbabilityCol, setThresholds
setRawPredictionCol
fit, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModelType, getSmoothing, modelType, smoothing
validateAndTransformSchema
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
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
getWeightCol, weightCol
write
save
validateAndTransformSchema
getRawPredictionCol, rawPredictionCol
getProbabilityCol, probabilityCol
getThresholds, thresholds
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public static NaiveBayes load(String path)
public static MLReader<T> read()
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)