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

54
LINES

< > BotCompany Repo | #1004698 // Algo Sucker [Predict "Maude Primer"]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 5312K of libraries. Click here for Pure Java version (2367L/15K/52K).

!752

static new HighestShortest highest;
static new ShortestPercentiles percentiles;
static S text;
static double lastScore;

p {
  load("highest");
  load("percentiles");
}

// returns true when updated result
static synchronized bool suck(S desc, Algorithm algorithm) {
  print("Best score: " + highest.score);
  bool saved = false;
  
  double score = scoreAlgorithm(algorithm);
  lastScore = score;
  
  if (highest.update(desc, score)) {
    save("highest");
    saved = true;
  }
  
  if (percentiles.update(desc, score)) {
    save("percentiles");
    saved = true;
  }
  
  ret saved;
}

static S highestDesc() {
  ret highest.a;
}

static double highestScore() {
  ret highest.score;
}

static double scoreAlgorithm(Algorithm algorithm) {
  ret scoreTextPredictAlgo(algorithm, getText());
}

static bool testLua(S luaCode) {
  ret suck("L " + luaCode, makeLuaTextPredictAlgo("L " + luaCode));
}

static S getText() {
  if (text == null)
    text = textFromUtf8(lzmaInputStream("#1004694"));
  ret text;
}

Author comment

Began life as a copy of #1004654

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xinetxnxrdbb

No comments. add comment

Snippet ID: #1004698
Snippet name: Algo Sucker [Predict "Maude Primer"]
Eternal ID of this version: #1004698/1
Text MD5: b31ab3bf6eb23157b4aa4156a8476341
Transpilation MD5: 915cd1e344a34361f74b94e19bdcc67f
Author: stefan
Category: javax / images
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-28 16:49:50
Source code size: 1067 bytes / 54 lines
Pitched / IR pitched: No / No
Views / Downloads: 586 / 1959
Referenced in: #1004699 - Feed Text Predict Sucker
#1004700 - Unit-Test Text Predict Sucker
#1004701 - Feed Text Predict Sucker With LUA [Early Spike]
#1004704 - Swing Text Predict
#1004707 - Text Learning [Swing]
#1004728 - Text Learn [Console / Keep Alive] - Args: sucker strat1 strat2 ...
#1004734 - Debug Text Predict Algo
#1004736 - Debug Text Predict Algo, Print Differences
#1004873 - class Sucker [text prediction]