예제 #1
0
        public override void SaveAsIni(TextWriter writer, RoleMappedSchema schema, ICalibrator calibrator = null)
        {
            Host.CheckValue(writer, nameof(writer));
            Host.CheckValue(schema, nameof(schema));
            Host.CheckValueOrNull(calibrator);

            var weights = Weight;

            writer.Write(LinearPredictorUtils.LinearModelAsIni(ref weights, Bias, this,
                                                               schema, calibrator as PlattCalibrator));
        }
예제 #2
0
        /// <summary>
        /// Output the INI model to a given writer
        /// </summary>
        public override void SaveAsIni(TextWriter writer, RoleMappedSchema schema, ICalibrator calibrator)
        {
            if (calibrator != null)
            {
                throw Host.ExceptNotImpl("Saving calibrators is not implemented yet.");
            }

            Host.CheckValue(writer, nameof(writer));
            Host.CheckValue(schema, nameof(schema));

            // REVIEW: For Poisson should encode the exp operation in the ini as well, bug 2433.
            var weights = Weight;

            writer.Write(LinearPredictorUtils.LinearModelAsIni(ref weights, Bias, this, schema, null));
        }