示例#1
0
        public override void SaveSummary(TextWriter writer, RoleMappedSchema schema)
        {
            Host.CheckValue(schema, nameof(schema));

            // REVIEW: Would be nice to have the settings!
            var weights = Weight;

            writer.WriteLine(LinearPredictorUtils.LinearModelAsText("Linear Binary Classification Predictor", null, null,
                                                                    ref weights, Bias, schema));

            _stats?.SaveText(writer, this, schema, 20);
        }
示例#2
0
        /// <summary>
        /// Output the text model to a given writer
        /// </summary>
        public void SaveAsText(TextWriter writer, RoleMappedSchema schema)
        {
            writer.WriteLine(nameof(MulticlassLogisticRegression) + " bias and non-zero weights");

            foreach (var namedValues in GetSummaryInKeyValuePairs(schema))
            {
                Host.Assert(namedValues.Value is float);
                writer.WriteLine("\t{0}\t{1}", namedValues.Key, (float)namedValues.Value);
            }

            if (_stats != null)
            {
                _stats.SaveText(writer, null, schema, 20);
            }
        }