Changeset 17930 for branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
 Timestamp:
 04/09/21 12:44:50 (16 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
r17830 r17930 785 785 s => 0, 786 786 v => { 787 int bins = (int)Math.Round(m.Scalar);787 int bins = Math.Max((int)Math.Round(m.Scalar), 1); 788 788 double minValue = v.Minimum(); 789 789 double maxValue = v.Maximum(); … … 794 794 double binMin = minValue * i; 795 795 double binMax = binMin + intervalWidth; 796 double countBin = v.Map(e => (e > binMin && e < binMax) ? 1 :0).Sum();796 double countBin = v.Map(e => (e > binMin && e < binMax) ? 1.0 : 0.0).Sum(); 797 797 double percBin = countBin / totalValues; 798 798 sum += percBin * Math.Log(percBin); … … 808 808 cur = AggregateApply(cur, 809 809 s => 0, 810 v => Statistics.PopulationStandardDeviation(v) > (Statistics.Maximum(v)  Statistics.Minimum(v)) / 2 ? 1 :0);810 v => Statistics.PopulationStandardDeviation(v) > (Statistics.Maximum(v)  Statistics.Minimum(v)) / 2 ? 1.0 : 0.0); 811 811 TraceEvaluation(currentInstr, cur); 812 812 return cur; … … 816 816 cur = AggregateApply(cur, 817 817 s => 0, 818 v => Statistics.PopulationVariance(v) > Statistics.StandardDeviation(v) ? 1 :0);818 v => Statistics.PopulationVariance(v) > Statistics.StandardDeviation(v) ? 1.0 : 0.0); 819 819 TraceEvaluation(currentInstr, cur); 820 820 return cur; … … 824 824 cur = AggregateApply(cur, 825 825 s => 0, 826 v => Math.Abs(Statistics.Mean(v)  Statistics.Median(v)) < (Statistics.Maximum(v)  Statistics.Minimum(v)) / 2 ? 1 :0);826 v => Math.Abs(Statistics.Mean(v)  Statistics.Median(v)) < (Statistics.Maximum(v)  Statistics.Minimum(v)) / 2 ? 1.0 : 0.0); 827 827 TraceEvaluation(currentInstr, cur); 828 828 return cur; … … 834 834 v => { 835 835 double mean = Statistics.Mean(v); 836 return v.Map(e => e > mean ? 1 :0).Sum();836 return v.Map(e => e > mean ? 1.0 : 0.0).Sum(); 837 837 }); 838 838 TraceEvaluation(currentInstr, cur); … … 845 845 v => { 846 846 double median = Statistics.Median(v); 847 return v.Map(e => e > median ? 1 :0).Sum();847 return v.Map(e => e > median ? 1.0 : 0.0).Sum(); 848 848 }); 849 849 TraceEvaluation(currentInstr, cur); … … 856 856 v => { 857 857 double mean = Statistics.Mean(v); 858 return v.Map(e => e < mean ? 1 :0).Sum();858 return v.Map(e => e < mean ? 1.0 : 0.0).Sum(); 859 859 }); 860 860 TraceEvaluation(currentInstr, cur); … … 867 867 v => { 868 868 double median = Statistics.Median(v); 869 return v.Map(e => e < median ? 1 :0).Sum();869 return v.Map(e => e < median ? 1.0 : 0.0).Sum(); 870 870 }); 871 871 TraceEvaluation(currentInstr, cur); … … 1055 1055 v => { 1056 1056 double sum = 0.0; 1057 int l = (int)Math.Round(lVal.Scalar);1057 int l = Math.Max((int)Math.Round(lVal.Scalar), 0); 1058 1058 double mean = Statistics.Mean(v); 1059 1059 for (int i = 0; i < v.Count  l; i++) { … … 1106 1106 s => 0, 1107 1107 v => { 1108 int lag = (int)Math.Round(l.Scalar);1108 int lag = Math.Max((int)Math.Round(l.Scalar), 0); 1109 1109 double sum = 0.0; 1110 1110 for (int i = 0; i < v.Count  2 * lag; i++) {
Note: See TracChangeset
for help on using the changeset viewer.