Libraryless. Click here for Pure Java version (7134L/46K).
1 | svoid test_AutoClassifier1() { |
2 | int n = 4; // number of examples to learn for - 4 actually work |
3 | AutoClassifier1<S> c = AutoClassifier1.queueLess(S); |
4 | |
5 | // no labels in empty classifier |
6 | classifier_testLabels(c, litorderedmap("hello", ll())); |
7 | |
8 | // train |
9 | c.learn(takeFirst((n+1)/2, ll("hello", "abcde", "xxxxx")), "5 chars"); |
10 | c.learn(takeFirst(n/2, ll("bla", "abcd", "aa")), "not 5 chars"); |
11 | |
12 | // test |
13 | classifier_testLabels(c, litorderedmap( |
14 | "world", ll("5 chars"), |
15 | "......", ll("not 5 chars"))); |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027850 |
Snippet name: | test_AutoClassifier1 (OK!) |
Eternal ID of this version: | #1027850/17 |
Text MD5: | d2af94f31a895eae5b86961c5c26086f |
Transpilation MD5: | 39b78ce606ba6973baed528582a0dcd3 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-14 15:04:10 |
Source code size: | 534 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 247 / 457 |
Version history: | 16 change(s) |
Referenced in: | [show references] |