public SymbolicClassificationSolution(ISymbolicClassificationModel model, IClassificationProblemData problemData)
      : base(model, problemData) {
      foreach (var node in model.SymbolicExpressionTree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>())
        node.SetGrammar(null);

      Add(new Result(ModelLengthResultName, "Length of the symbolic classification model.", new IntValue()));
      Add(new Result(ModelDepthResultName, "Depth of the symbolic classification model.", new IntValue()));
      RecalculateResults();
    }
Example #2
0
        public SymbolicClassificationSolution(ISymbolicClassificationModel model, IClassificationProblemData problemData)
            : base(model, problemData)
        {
            foreach (var node in model.SymbolicExpressionTree.Root.IterateNodesPrefix().OfType <SymbolicExpressionTreeTopLevelNode>())
            {
                node.SetGrammar(null);
            }

            Add(new Result(ModelLengthResultName, "Length of the symbolic classification model.", new IntValue()));
            Add(new Result(ModelDepthResultName, "Depth of the symbolic classification model.", new IntValue()));
            RecalculateResults();
        }
Example #3
0
        public static double CalculateQualityForImpacts(ISymbolicClassificationModel model, IClassificationProblemData problemData, IEnumerable <int> rows)
        {
            OnlineCalculatorError errorState;
            var dataset                      = problemData.Dataset;
            var targetClassValues            = dataset.GetDoubleValues(problemData.TargetVariable, rows);
            var originalClassValues          = model.GetEstimatedClassValues(dataset, rows);
            var qualityForImpactsCalculation = OnlineAccuracyCalculator.Calculate(targetClassValues, originalClassValues, out errorState);

            if (errorState != OnlineCalculatorError.None)
            {
                qualityForImpactsCalculation = 0.0;
            }

            return(qualityForImpactsCalculation);
        }
    public static double CalculateQualityForImpacts(ISymbolicClassificationModel model, IClassificationProblemData problemData, IEnumerable<int> rows) {
      OnlineCalculatorError errorState;
      var dataset = problemData.Dataset;
      var targetClassValues = dataset.GetDoubleValues(problemData.TargetVariable, rows);
      var originalClassValues = model.GetEstimatedClassValues(dataset, rows);
      var qualityForImpactsCalculation = OnlineAccuracyCalculator.Calculate(targetClassValues, originalClassValues, out errorState);
      if (errorState != OnlineCalculatorError.None) qualityForImpactsCalculation = 0.0;

      return qualityForImpactsCalculation;
    }