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(); }
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="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(); }