org.encog.ml.bayesian.training
Class TrainBayesian
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.ml.bayesian.training.TrainBayesian
-
- All Implemented Interfaces:
- MLTrain
public class TrainBayesian extends BasicTraining
Train a Bayesian network.
-
-
Constructor Summary
Constructors Constructor and Description TrainBayesian(BayesianNetwork theNetwork, MLDataSet theData, int theMaximumParents)Construct a Bayesian trainer.TrainBayesian(BayesianNetwork theNetwork, MLDataSet theData, int theMaximumParents, BayesianInit theInit, BayesSearch theSearch, BayesEstimator theEstimator)Construct a Bayesian trainer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContinue()BayesianInitgetInitNetwork()intgetMaximumParents()MLMethodgetMethod()Get the current best machine learning method from the training.BayesianNetworkgetNetwork()BayesSearchgetSearch()booleanisTrainingDone()voiditeration()Perform one iteration of training.TrainingContinuationpause()Pause the training to continue later.voidresume(TrainingContinuation state)Resume training.voidsetInitNetwork(BayesianInit initNetwork)Set the network init method.-
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, finishTraining, getError, getImplementationType, getIteration, getStrategies, getTraining, iteration, postIteration, preIteration, setError, setIteration, setTraining
-
-
-
-
Constructor Detail
-
TrainBayesian
public TrainBayesian(BayesianNetwork theNetwork, MLDataSet theData, int theMaximumParents)
Construct a Bayesian trainer. Use K2 to search, and the SimpleEstimator to estimate probability. Init as Naive Bayes- Parameters:
theNetwork- The network to train.theData- The data to train.theMaximumParents- The max number of parents.
-
TrainBayesian
public TrainBayesian(BayesianNetwork theNetwork, MLDataSet theData, int theMaximumParents, BayesianInit theInit, BayesSearch theSearch, BayesEstimator theEstimator)
Construct a Bayesian trainer.- Parameters:
theNetwork- The network to train.theData- The data to train with.theMaximumParents- The maximum number of parents.theInit- How to init the new Bayes network.theSearch- The search method.theEstimator- The estimation mehod.
-
-
Method Detail
-
isTrainingDone
public boolean isTrainingDone()
- Specified by:
isTrainingDonein interfaceMLTrain- Overrides:
isTrainingDonein classBasicTraining- Returns:
- True if training can progress no further.
-
iteration
public void iteration()
Perform one iteration of training.
-
canContinue
public boolean canContinue()
- Returns:
- True if the training can be paused, and later continued.
-
pause
public TrainingContinuation pause()
Pause the training to continue later.- Returns:
- A training continuation object.
-
resume
public void resume(TrainingContinuation state)
Resume training.- Parameters:
state- The training continuation object to use to continue.
-
getMethod
public MLMethod getMethod()
Get the current best machine learning method from the training.- Returns:
- The best machine learning method.
-
getNetwork
public BayesianNetwork getNetwork()
- Returns:
- the network
-
getMaximumParents
public int getMaximumParents()
- Returns:
- the maximumParents
-
getSearch
public BayesSearch getSearch()
- Returns:
- The search method.
-
getInitNetwork
public BayesianInit getInitNetwork()
- Returns:
- The init method.
-
setInitNetwork
public void setInitNetwork(BayesianInit initNetwork)
Set the network init method.- Parameters:
initNetwork- The init method.
-
-
DMelt 3.0 © DataMelt by jWork.ORG