Ejemplo n.º 1
0
        /// <summary>
        /// Constructor for a maximum entropy model trained using the
        /// Generalized Iterative Scaling procedure.
        /// </summary>
        /// <param name="reader">
        /// A reader providing the data for the model.
        /// </param>
        public GisModel(IO.IGisModelReader reader)
        {
            this._reader = reader;
            _outcomeNames = reader.GetOutcomeLabels();
            CorrectionConstant = reader.CorrectionConstant;
            CorrectionParameter = reader.CorrectionParameter;

            _outcomeCount = _outcomeNames.Length;
            _initialProbability = Math.Log(1.0 / _outcomeCount);
            _correctionConstantInverse = 1.0 / CorrectionConstant;
            _featureCounts = new int[_outcomeCount];
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor for a maximum entropy model trained using the
        /// Generalized Iterative Scaling procedure.
        /// </summary>
        /// <param name="reader">
        /// A reader providing the data for the model.
        /// </param>
        public GisModel(IO.IGisModelReader reader)
        {
            mReader = reader;
            mOutcomeNames = reader.GetOutcomeLabels();
            mCorrectionConstant = (double)reader.CorrectionConstant;
            mCorrectionParameter = reader.CorrectionParameter;

            mOutcomeCount = mOutcomeNames.Length;
            mInitialProbability = System.Math.Log(1.0 / mOutcomeCount);
            mCorrectionConstantInverse = 1.0 / mCorrectionConstant;
            mFeatureCounts = new int[mOutcomeCount];
        }