Exemplo n.º 1
0
        /// <summary>
        /// Construct a Bayesian trainer.
        /// </summary>
        /// <param name="theNetwork">The network to train.</param>
        /// <param name="theData">The data to train with.</param>
        /// <param name="theMaximumParents">The maximum number of parents.</param>
        /// <param name="theInit">How to init the new Bayes network.</param>
        /// <param name="theSearch">The search method.</param>
        /// <param name="theEstimator">The estimation mehod.</param>
        public TrainBayesian(BayesianNetwork theNetwork, IMLDataSet theData,
                             int theMaximumParents, BayesianInit theInit, IBayesSearch theSearch,
                             IBayesEstimator theEstimator)
            : base(TrainingImplementationType.Iterative)
        {
            _network        = theNetwork;
            _data           = theData;
            _maximumParents = theMaximumParents;

            _search = theSearch;
            _search.Init(this, theNetwork, theData);

            _estimator = theEstimator;
            _estimator.Init(this, theNetwork, theData);

            _initNetwork = theInit;
            Error        = 1.0;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Construct a Bayesian trainer. 
        /// </summary>
        /// <param name="theNetwork">The network to train.</param>
        /// <param name="theData">The data to train with.</param>
        /// <param name="theMaximumParents">The maximum number of parents.</param>
        /// <param name="theInit">How to init the new Bayes network.</param>
        /// <param name="theSearch">The search method.</param>
        /// <param name="theEstimator">The estimation mehod.</param>
        public TrainBayesian(BayesianNetwork theNetwork, IMLDataSet theData,
                             int theMaximumParents, BayesianInit theInit, IBayesSearch theSearch,
                             IBayesEstimator theEstimator)
            : base(TrainingImplementationType.Iterative)
        {
            _network = theNetwork;
            _data = theData;
            _maximumParents = theMaximumParents;

            _search = theSearch;
            _search.Init(this, theNetwork, theData);

            _estimator = theEstimator;
            _estimator.Init(this, theNetwork, theData);

            _initNetwork = theInit;
            Error = 1.0;
        }