예제 #1
0
        public SVMConfiguration GetConfiguration()
        {
            SVMConfiguration retVal = new SVMConfiguration(Parameters[0], features);

            retVal.Name = Name;
            return(retVal);
        }
예제 #2
0
        public SVMConfiguration GenerateConfiguration()
        {
            SVMConfiguration conf = new SVMConfiguration(svmParams, features);

            conf.Name = "SVM_" + svmParams.C + "_" + svmParams.Gamma + "_F" + features.Count;
            return(conf);
        }
예제 #3
0
        public static SVMConfiguration Deserialize(string input)
        {
            SVMConfiguration retVal = new SVMConfiguration();
            retVal.parameters = new SVMParameter();
            string[] bits = input.Split(SEPARATOR);

            retVal.Name = bits[0];
            retVal.parameters.C = double.Parse(bits[1]);
            retVal.parameters.Gamma = double.Parse(bits[2]);
            retVal.parameters.Kernel = (SVMKernelType)Enum.Parse(typeof(SVMKernelType), bits[3]);
            retVal.features = FeatureCreator.GetFeaturesFromString(bits[4]);

            return retVal;
        }
예제 #4
0
        public static SVMConfiguration Deserialize(string input)
        {
            SVMConfiguration retVal = new SVMConfiguration();

            retVal.parameters = new SVMParameter();
            string[] bits = input.Split(SEPARATOR);

            retVal.Name              = bits[0];
            retVal.parameters.C      = double.Parse(bits[1]);
            retVal.parameters.Gamma  = double.Parse(bits[2]);
            retVal.parameters.Kernel = (SVMKernelType)Enum.Parse(typeof(SVMKernelType), bits[3]);
            retVal.features          = FeatureCreator.GetFeaturesFromString(bits[4]);


            return(retVal);
        }
예제 #5
0
        public static MetaSVMConfiguration Deserialize(string input)
        {
            MetaSVMConfiguration msvmc = new MetaSVMConfiguration();
            var bits = input.Split(META_SEPARATOR);

            msvmc.Name            = bits[0];
            msvmc.parameter.C     = double.Parse(bits[1]);
            msvmc.parameter.Gamma = double.Parse(bits[2]);

            foreach (var item in bits.Skip(3))
            {
                msvmc.stds.Add(SVMConfiguration.Deserialize(item));
            }

            return(msvmc);
        }
예제 #6
0
 public StdClassifier(SVMConfiguration conf, SAMData samData)
     : base(conf.Name, conf.GetParameter(), samData)
 {
     features = conf.GetFeautres();
 }
예제 #7
0
 public SVMConfiguration GetConfiguration()
 {
     SVMConfiguration retVal = new SVMConfiguration(Parameters[0], features);
     retVal.Name = Name;
     return retVal;
 }
예제 #8
0
 public SVMConfiguration GenerateConfiguration()
 {
     SVMConfiguration conf = new SVMConfiguration(svmParams, features);
     conf.Name = "SVM_" + svmParams.C + "_" + svmParams.Gamma + "_F" + features.Count;
     return conf;
 }
예제 #9
0
파일: Form1.cs 프로젝트: Malakahh/BesterUI
        void SaveConfiguration(SVMConfiguration conf)
        {
            if (!svmConfs.Contains(conf))
            {
                this.Invoke((MethodInvoker)delegate { svmConfs.Add(conf); });
            }

            if (!Directory.Exists(currentPath + @"\STD"))
            {
                Directory.CreateDirectory(currentPath + @"\STD");
            }

            File.WriteAllText(currentPath + @"\STD\" + conf.Name + ".svm", conf.Serialize());
        }
예제 #10
0
 public StdClassifier(SVMConfiguration conf, SAMData samData) : base(conf.Name, conf.GetParameter(), samData)
 {
     features = conf.GetFeautres();
 }