cytoai / autotuner

Model selection and hyper-parameter tuning module.
MIT License
3 stars 0 forks source link

TypeError: Index must be an integer (value: undefined) #1

Open tadeuszwojcik opened 6 years ago

tadeuszwojcik commented 6 years ago

Hi, Thanks for releasing this code, it looks really interesting! I'd like to use it to find best fit parameters for bit different domain, algo trading params to be precise. To be honest I have no idea it it would work. When running sample from readme I've run into following error:

TypeError: Index must be an integer (value: undefined)
    at exports.validateIndex (C:\Users\tadeu\Projects\bitmex-futures\node_modules\mathjs\lib\utils\array.js:94:11)
    at _get (C:\Users\tadeu\Projects\bitmex-futures\node_modules\mathjs\lib\type\matrix\DenseMatrix.js:241:9)
    at DenseMatrix.subset (C:\Users\tadeu\Projects\bitmex-futures\node_modules\mathjs\lib\type\matrix\DenseMatrix.js:135:16)
    at Optimizer.getNextPoint (C:\Users\tadeu\Projects\bitmex-futures\node_modules\autotuner\optimizer.js:87:41)
    at Object.<anonymous> (C:\Users\tadeu\Projects\bitmex-futures\test.js:16:19)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)

I think this is because I need to call addSample first, am I correct? Would it be possible to have option to have it working even when no samples are added?

Let's say I have following code:

var p = new autotuner.Paramspace();
p.addModel('tradesProfit', { param1: [1, 2, 3...1000], param2: [0....200]});

I assume for given iterations count (not sure what would be optimal value) I'd run my algorithm that would return expected profit for given params, and then add it as a sample, but not sure what is quality metric value, how that should be specified?

I'm really newbie to parameter optimization space, so please forgive me my silly questions, I'd really appreciate if you could point me into the right direction, anything would help (articles, blogs etc) Thanks!

runk commented 4 years ago

Having similar problem. Example from readme crashes.

sbrl commented 4 years ago

I've also encountered this error. Ping @cytoai.

I'm trying to use this for hyper parameter optimisation in my PhD project.

bojan-karlas commented 4 years ago

Hello, sorry for not responding to this request. This project was done as part of a hackathon during the first year of my PhD and we simply released in hope that it can be useful for other people. Unfortunately, I didn't specify that I didn't plan on maintaining this project.

With regards to the question posted by @tadeuszwojcik, as far as I can remember, the tool should work even when you haven't yet called addSample. Samples that are added in each iteration should improve subsequent suggestions.

I fear that my code has a bug in the way it extracts the subset from the array this.mean in optimizer.js line 87. If anyone is motivated to take a shot at fixing this, feel free to send a merge request.

These references might come in handy:

sbrl commented 3 years ago

No worries. I ended up using a random algorithm of my own design instead.