Changeset 12395 for branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters
- Timestamp:
- 05/20/15 16:41:14 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs
r11205 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 203 203 stringBuilder.Append(FormatRecursively(node.GetSubtree(1))); 204 204 stringBuilder.Append(",0))"); 205 } else if (symbol is IfThenElse) { 206 stringBuilder.Append("IF("); 207 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + " ) > 0"); 208 stringBuilder.Append(","); 209 stringBuilder.Append(FormatRecursively(node.GetSubtree(1))); 210 stringBuilder.Append(","); 211 stringBuilder.Append(FormatRecursively(node.GetSubtree(2))); 212 stringBuilder.Append(")"); 213 } else if (symbol is VariableCondition) { 214 VariableConditionTreeNode variableConditionTreeNode = node as VariableConditionTreeNode; 215 double threshold = variableConditionTreeNode.Threshold; 216 double slope = variableConditionTreeNode.Slope; 217 string p = "(1 / (1 + EXP(-" + slope.ToString(CultureInfo.InvariantCulture) + " * (" + GetColumnToVariableName(variableConditionTreeNode.VariableName) + "-" + threshold.ToString(CultureInfo.InvariantCulture) + "))))"; 218 stringBuilder.Append("(("); 219 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 220 stringBuilder.Append("*"); 221 stringBuilder.Append(p); 222 stringBuilder.Append(") + ("); 223 stringBuilder.Append(FormatRecursively(node.GetSubtree(1))); 224 stringBuilder.Append("*("); 225 stringBuilder.Append("1 - " + p + ")"); 226 stringBuilder.Append("))"); 227 } else if (symbol is Xor) { 228 stringBuilder.Append("IF("); 229 stringBuilder.Append("XOR("); 230 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,"); 231 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0"); 232 stringBuilder.Append("), 1.0, -1.0)"); 233 } else if (symbol is Or) { 234 stringBuilder.Append("IF("); 235 stringBuilder.Append("OR("); 236 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,"); 237 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0"); 238 stringBuilder.Append("), 1.0, -1.0)"); 239 } else if (symbol is And) { 240 stringBuilder.Append("IF("); 241 stringBuilder.Append("AND("); 242 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(0)) + ") > 0,"); 243 stringBuilder.Append("(" + FormatRecursively(node.GetSubtree(1)) + ") > 0"); 244 stringBuilder.Append("), 1.0, -1.0)"); 245 } else if (symbol is Not) { 246 stringBuilder.Append("IF("); 247 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 248 stringBuilder.Append(" > 0, -1.0, 1.0)"); 249 } else if (symbol is GreaterThan) { 250 stringBuilder.Append("IF(("); 251 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 252 stringBuilder.Append(") > ("); 253 stringBuilder.Append(FormatRecursively(node.GetSubtree(1))); 254 stringBuilder.Append("), 1.0, -1.0)"); 255 } else if (symbol is LessThan) { 256 stringBuilder.Append("IF(("); 257 stringBuilder.Append(FormatRecursively(node.GetSubtree(0))); 258 stringBuilder.Append(") < ("); 259 stringBuilder.Append(FormatRecursively(node.GetSubtree(1))); 260 stringBuilder.Append("), 1.0, -1.0)"); 205 261 } else { 206 262 throw new NotImplementedException("Excel export of " + node.Symbol + " is not implemented."); -
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs
r11205 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs
r11205 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs
r11205 r12395 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.