Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tadeuszwojcik opened this issue Jun 18, 2018 · 4 comments
Open

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

tadeuszwojcik opened this issue Jun 18, 2018 · 4 comments
Assignees

Comments

@tadeuszwojcik
Copy link

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
Copy link

runk commented Apr 2, 2020

Having similar problem. Example from readme crashes.

@sbrl
Copy link

sbrl commented Jul 31, 2020

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

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

@bojan-karlas
Copy link
Contributor

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
Copy link

sbrl commented Nov 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants