Changeset 17556 for branches/3040_VectorBasedGP
- Timestamp:
- 05/25/20 16:11:46 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
r17554 r17556 373 373 var cur = Evaluate(dataset, ref row, state); 374 374 return AggregateApply(cur, 375 s => 0,376 v => v.Count > 1 ? Statistics.StandardDeviation(v) : 0);375 s => double.NaN, 376 v => Statistics.StandardDeviation(v)); 377 377 } 378 378 case OpCodes.Length: { 379 379 var cur = Evaluate(dataset, ref row, state); 380 380 return AggregateApply(cur, 381 s => 0,382 v => v.Count > 1 ? v.Count : 0);381 s => 1, 382 v => v.Count); 383 383 } 384 384 case OpCodes.Min: { 385 385 var cur = Evaluate(dataset, ref row, state); 386 386 return AggregateApply(cur, 387 s => 0,388 v => v.Count > 1 ? Statistics.Minimum(v) : 0);387 s => s, 388 v => Statistics.Minimum(v)); 389 389 } 390 390 case OpCodes.Max: { 391 391 var cur = Evaluate(dataset, ref row, state); 392 392 return AggregateApply(cur, 393 s => 0,394 v => v.Count > 1 ? Statistics.Maximum(v) : 0);393 s => s, 394 v => Statistics.Maximum(v)); 395 395 } 396 396 case OpCodes.Variance: { 397 397 var cur = Evaluate(dataset, ref row, state); 398 398 return AggregateApply(cur, 399 s => 0,400 v => v.Count > 1 ? Statistics.Variance(v) : 0);399 s => double.NaN, 400 v => Statistics.Variance(v)); 401 401 } 402 402 case OpCodes.Skewness: { 403 403 var cur = Evaluate(dataset, ref row, state); 404 404 return AggregateApply(cur, 405 s => 0,406 v => v.Count > 1 ? Statistics.Skewness(v) : 0);405 s => double.NaN, 406 v => Statistics.Skewness(v)); 407 407 } 408 408 case OpCodes.Kurtosis: { 409 409 var cur = Evaluate(dataset, ref row, state); 410 410 return AggregateApply(cur, 411 s => 0,412 v => v.Count > 1 ? Statistics.Kurtosis(v) : 0);411 s => double.NaN, 412 v => Statistics.Kurtosis(v)); 413 413 } 414 414 case OpCodes.EuclideanDistance: { … … 419 419 //(s1, v2) => Math.Sqrt((s1 - v2).PointwisePower(2).Sum()), 420 420 //(v1, s2) => Math.Sqrt((v1 - s2).PointwisePower(2).Sum()), 421 vvFunc: (v1, v2) => Math.Sqrt((v1 - v2).PointwisePower(2).Sum()) 422 ); 421 vvFunc: (v1, v2) => v1.Count == v2.Count ? Math.Sqrt((v1 - v2).PointwisePower(2).Sum()) : double.NaN); 423 422 } 424 423 case OpCodes.Covariance: { … … 429 428 //(s1, v2) => 0, 430 429 //(v1, s2) => 0, 431 vvFunc: (v1, v2) => v1.Count > 1 && v2.Count > 1 ? Statistics.Covariance(v1, v2) : double.NaN 432 ); 430 vvFunc: (v1, v2) => v1.Count == v2.Count ? Statistics.Covariance(v1, v2) : double.NaN); 433 431 } 434 432 case OpCodes.Variable: {
Note: See TracChangeset
for help on using the changeset viewer.