Package org.apache.spark.ml.clustering
Class DistributedLDAModel
Object
org.apache.spark.ml.PipelineStage
org.apache.spark.ml.Transformer
org.apache.spark.ml.Model<LDAModel>
org.apache.spark.ml.clustering.LDAModel
org.apache.spark.ml.clustering.DistributedLDAModel
- All Implemented Interfaces:
Serializable,org.apache.spark.internal.Logging,LDAParams,Params,HasCheckpointInterval,HasFeaturesCol,HasMaxIter,HasSeed,Identifiable,MLWritable
Distributed model fitted by
LDA.
This type of model is currently only produced by Expectation-Maximization (EM).
This model stores the inferred topics, the full training dataset, and the topic distribution for each training document.
param: oldLocalModelOption Used to implement oldLocalModel() as a lazy val, but keeping
copy() cheap.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter -
Method Summary
Modifier and TypeMethodDescriptionCreates a copy of this instance with the same UID and some extra params.voidRemove any remaining checkpoint files from training.String[]If using checkpointing andLDA.keepLastCheckpointis set to true, then there may be saved checkpoint files.booleanIndicates whether this instance is of typeDistributedLDAModelstatic DistributedLDAModeldoublelogPrior()static MLReader<DistributedLDAModel>read()toLocal()Convert this distributed model to a local representation.toString()doublewrite()Returns anMLWriterinstance for this ML instance.Methods inherited from class org.apache.spark.ml.clustering.LDAModel
checkpointInterval, describeTopics, describeTopics, docConcentration, estimatedDocConcentration, featuresCol, k, keepLastCheckpoint, learningDecay, learningOffset, logLikelihood, logPerplexity, maxIter, optimizeDocConcentration, optimizer, seed, setFeaturesCol, setSeed, setTopicDistributionCol, subsamplingRate, supportedOptimizers, topicConcentration, topicDistributionCol, topicsMatrix, transform, transformSchema, uid, vocabSizeMethods inherited from class org.apache.spark.ml.Transformer
transform, transform, transformMethods inherited from class org.apache.spark.ml.PipelineStage
paramsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.spark.ml.param.shared.HasCheckpointInterval
getCheckpointIntervalMethods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesCol
getFeaturesColMethods inherited from interface org.apache.spark.ml.param.shared.HasMaxIter
getMaxIterMethods inherited from interface org.apache.spark.ml.clustering.LDAParams
getDocConcentration, getK, getKeepLastCheckpoint, getLearningDecay, getLearningOffset, getOldDocConcentration, getOldOptimizer, getOldTopicConcentration, getOptimizeDocConcentration, getOptimizer, getSubsamplingRate, getTopicConcentration, getTopicDistributionCol, validateAndTransformSchemaMethods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContextMethods inherited from interface org.apache.spark.ml.util.MLWritable
saveMethods inherited from interface org.apache.spark.ml.param.Params
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
-
Method Details
-
read
-
load
-
toLocal
Convert this distributed model to a local representation. This discards info about the training dataset.WARNING: This involves collecting a large
LDAModel.topicsMatrix()to the driver.- Returns:
- (undocumented)
-
copy
Description copied from interface:ParamsCreates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly. SeedefaultCopy(). -
isDistributed
public boolean isDistributed()Description copied from class:LDAModelIndicates whether this instance is of typeDistributedLDAModel- Specified by:
isDistributedin classLDAModel
-
trainingLogLikelihood
public double trainingLogLikelihood() -
logPrior
public double logPrior() -
getCheckpointFiles
If using checkpointing andLDA.keepLastCheckpointis set to true, then there may be saved checkpoint files. This method is provided so that users can manage those files.Note that removing the checkpoints can cause failures if a partition is lost and is needed by certain
DistributedLDAModelmethods. Reference counting will clean up the checkpoints when this model and derivative data go out of scope.- Returns:
- Checkpoint files from training
-
deleteCheckpointFiles
public void deleteCheckpointFiles()Remove any remaining checkpoint files from training.- See Also:
-
write
Description copied from interface:MLWritableReturns anMLWriterinstance for this ML instance.- Returns:
- (undocumented)
-
toString
- Specified by:
toStringin interfaceIdentifiable- Overrides:
toStringin classObject
-