Ejemplo n.º 1
0
        /// <summary>
        /// Gets the default parameters.
        /// </summary>
        /// <returns>The default parameters.</returns>
        public static TrainingParameters DefaultParameters()
        {
            var p = new TrainingParameters();

            p.Set(Parameters.Algorithm, "MAXENT");
            p.Set(Parameters.TrainerType, "Event");
            p.Set(Parameters.Iterations, "100");
            p.Set(Parameters.Cutoff, "5");

            return(p);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the properties in the specified namespace.
        /// </summary>
        /// <param name="ns">The namespace.</param>
        /// <returns>A <see cref="TrainingParameters"/> containing the properties in the specified namespace.</returns>
        public TrainingParameters GetNamespace(string ns)
        {
            if (!ns.EndsWith("."))
            {
                ns = ns + ".";
            }

            var p = new TrainingParameters();

            foreach (var pk in properties)
            {
                if (pk.StartsWith(ns))
                {
                    string key = pk.Substring(ns.Length);
                    p.Set(key, properties[pk]);
                }
            }
            return(p);
        }