protected PerceptronModelWriter(AbstractModel model) {
            var data = model.GetDataStructures();
            numOutcomes = model.GetNumOutcomes();
            PARAMS = (Context[])data[0];
            OUTCOME_LABELS = (string[])data[2];

            var map = (IndexHashTable<string>)data[1];
            PRED_LABELS = new string[map.Size];
            map.ToArray(PRED_LABELS);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NaiveBayesModelWriter"/> class.
        /// </summary>
        /// <param name="model">The model.</param>
        protected NaiveBayesModelWriter(AbstractModel model)
        {
            var data = model.GetDataStructures();

            numOutcomes = model.GetNumOutcomes();
            Parameters  = (Context[])data[0];
            var map = (IndexHashTable <string>)data[1];

            OutcomeLabels = (string[])data[2];

            PredLabels = map.ToArray();
        }
Exemple #3
0
        protected PerceptronModelWriter(AbstractModel model)
        {
            var data = model.GetDataStructures();

            numOutcomes    = model.GetNumOutcomes();
            PARAMS         = (Context[])data[0];
            OUTCOME_LABELS = (string[])data[2];

            var map = (IndexHashTable <string>)data[1];

            PRED_LABELS = new string[map.Size];
            map.ToArray(PRED_LABELS);
        }
        /// <para>
        ///   <c>index 0</c>: <see cref="T:Context[]"/> containing the model parameters.
        ///   <c>index 1</c>: <see cref="T:IndexHashTable{string}"/> containing the mapping of model predicates to unique integers.
        ///   <c>index 2</c>: <see cref="T:string[]"/> containing the names of the outcomes, stored in the index of the array which represents their unique ids in the model.
        ///   <c>index 3</c>: <see cref="T:double"/> containing the value of the models correction constant.
        ///   <c>index 4</c>: <see cref="T:double"/> containing the value of the models correction parameter.
        /// </para>
        ///
        protected GISModelWriter(AbstractModel model)
        {
            var data = model.GetDataStructures();

            Parameters = (Context[])data[0];
            var map = (IndexHashTable <string>)data[1];

            OutcomeLabels      = (string[])data[2];
            CorrectionConstant = (int)data[3];
            CorrectionParam    = (double)data[4];

            PredLabels = map.ToArray();
        }
Exemple #5
0
        /// <para>
        ///   <c>index 0</c>: <see cref="T:Context[]"/> containing the model parameters.
        ///   <c>index 1</c>: <see cref="T:IndexHashTable{string}"/> containing the mapping of model predicates to unique integers.
        ///   <c>index 2</c>: <see cref="T:string[]"/> containing the names of the outcomes, stored in the index of the array which represents their unique ids in the model.
        ///   <c>index 3</c>: <see cref="T:double"/> containing the value of the models correction constant.
        ///   <c>index 4</c>: <see cref="T:double"/> containing the value of the models correction parameter.
        /// </para>
        ///
        protected GISModelWriter(AbstractModel model)
        {
            var data = model.GetDataStructures();

            PARAMS = (Context[])data[0];
            var map = (IndexHashTable <string>)data[1];

            OUTCOME_LABELS      = (string[])data[2];
            CORRECTION_CONSTANT = (int)data[3];  // string[] ??????????
            CORRECTION_PARAM    = (Double)data[4];

            PRED_LABELS = new String[map.Size];
            map.ToArray(PRED_LABELS);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PerceptronModelWriter"/> class.
        /// </summary>
        /// <param name="model">The model.</param>
        protected PerceptronModelWriter(AbstractModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            var data = model.GetDataStructures();

            numOutcomes = model.GetNumOutcomes();

            Parameters    = (Context[])data[0];
            OutcomeLabels = (string[])data[2];
            PredLabels    = ((IndexHashTable <string>)data[1]).ToArray();
        }