Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1030117 // findThreshold_unmoved - just average between max of l1 and max of l2

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2654L/16K).

1  
// find best threshold value to separate list1 (smaller values) from list2 (bigger values), minimizing false positives + false negatives
2  
// returns (threshold, false positives, false negatives)
3  
static T3<Double, Int, Int> findThreshold_unmoved(Cl<Double> list1, Cl<Double> list2) {
4  
  if (empty(list1) || empty(list2)) null;
5  
  double threshold = avg(doubleMax(list1), doubleMin(list2));
6  
  int falsePositives = countPred(list1, d -> d > threshold);
7  
  int falseNegatives = countPred(list2, d -> d <= threshold);
8  
  ret t3(threshold, falsePositives, falseNegatives);
9  
}

Author comment

Began life as a copy of #1030114

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030117
Snippet name: findThreshold_unmoved - just average between max of l1 and max of l2
Eternal ID of this version: #1030117/1
Text MD5: 5c731b50094d11faf668fccdf08517ea
Transpilation MD5: 3b2ae53ab611e2c750172a99f2228a8b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-09 14:03:12
Source code size: 571 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 240 / 324
Referenced in: [show references]