public ReportLikelihood <DomainType, LabelType> GenerateAndTestLikelihood(IDataSet <DomainType, LabelType> training_set, IDataSet <DomainType, LabelType> test_set)
        {
            IModelLikelihood <DomainType, LabelType> model = GenerateModelLikelihood(training_set);

            double[][]  likelihoods = new double[test_set.InstanceCount][];
            LabelType[] labels      = new LabelType[test_set.InstanceCount];
            for (int instance_index = 0; instance_index < test_set.InstanceCount; instance_index++)
            {
                likelihoods[instance_index] = model.GetLikelihoods(test_set.GetInstanceFeatureData(instance_index));
            }

            return(new ReportLikelihood <DomainType, LabelType>(model, likelihoods, labels));
        }
        public static double ROCP <DomainType>(
            IModelLikelihood <DomainType, bool> model_0,
            IModelLikelihood <DomainType, bool> model_1,
            IDataSet <DomainType, bool> test_set,
            bool label_value)
        {
            if (!model_0.DataContext.Equals(model_0.DataContext))
            {
                throw new Exception("DataContext Mismatch");
            }
            TestROCHanleyMcNeil test = new TestROCHanleyMcNeil();

            return(0);
        }
Exemplo n.º 3
0
        public PolicySVMHistoryRaw(List <PriceCandle> training_data, int history_count, double c, double gamma)
        {
            this.history_count = history_count;
            this.training_data = training_data;
            ITemplateModelLikelihood <double, int> template = new TemplateModelLibSVMCSVC(c, gamma);
            IDataContext data_context_labeled = null;

            double[][] feature_data = null;

            IIndicator indicator = new IndicatorMagicProfit(60);

            //MarketModel model = new MarketModel(100000, training_data[0].Open, );
            //indicator.ComputeAll();
            int[][] label_data = null;
            IDataSet <double, int> training_set = new DataSet <double, int>(data_context_labeled, feature_data, label_data);

            model = template.GenerateModelLikelihood(training_set);
        }
Exemplo n.º 4
0
 public ReportLikelihood(IModelLikelihood <DomainType, LabelType> model, double[][] likelihoods, LabelType [] label_values)
 {
     this.Model        = model;
     this.likelihoods  = likelihoods;
     this.label_values = null;
 }
 public static double AUCP <DomainType, LabelType>  (
     IModelLikelihood <DomainType, LabelType> model_0,
     IDataSet <DomainType, LabelType> test_set)
 {
     return(0);
 }