static F1<S> ai_trainable_multiplyingNumberConversion(LS trainingParams) { double ratio = 1; S pat = null; for (S key, S value : listParamsToMap(trainingParams)) { long a = parseFirstLong(key), b = parseFirstLong(value); pat = replaceFirstLong(value, "*"); ratio = doubleRatio(b, a); } final double _ratio = ratio; final S _pat = pat; ret func(S s) -> S { format(_pat, round(parseFirstLong(s)*_ratio)) }; }
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020473 |
Snippet name: | ai_trainable_multiplyingNumberConversion |
Eternal ID of this version: | #1020473/3 |
Text MD5: | 27c3c3075c5d0d29350e165aed8d35a9 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-23 19:30:18 |
Source code size: | 443 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 367 / 395 |
Version history: | 2 change(s) |
Referenced in: | [show references] |