Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 818 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Slow backtest performance using R #453358
07/22/15 14:02
07/22/15 14:02
Joined: Mar 2012
Posts: 6
C
chrisr Offline OP
Newbie
chrisr  Offline OP
Newbie
C

Joined: Mar 2012
Posts: 6
Hi, first of all thanks for the R integration => works perfect!

Is there a way to improve the backtesting performance using "Test"/"Train" modes?

Cheers
C.

Re: Slow backtest performance using R [Re: chrisr] #453360
07/22/15 14:49
07/22/15 14:49
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
- Make as few calls out from Zorro to R as necessary. Consolidate fixed sequences of commands into functions written on the R side.
- For training, library "parallel" offers some parallelization and is supported by some modeling types
- If desperate and/or ambitious, use Zorro Train mode only to produce the csv files, then produce Rdata for each cycle completely outside of Zorro. Only Test mode uses RBridge and simply expects Rdata files to already exist.
- In that case, you can additionally train on Linux and take advantage of library "multicore" and "doMC", which library "caret" loves.

Re: Slow backtest performance using R [Re: GPEngine] #453362
07/22/15 15:12
07/22/15 15:12
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
If its the actually time to build the models within R that bothers you, what can I say. Machine Learning is not a simple calculation and often involves executing dead and inferior branches that are not part of the eventual solution.

Check your data dimensions.
- typically, modeling time depends on the number of training examples. Use R "sample" method as a sledgehammer for reducing it.
- typically, modeling time depends on the number of features. Detect near-zero-variance features, use covariance matrix to detect identical features, or use advanced feature selection such as recursive feature elimination -- but that has its own cost.

Re: Slow backtest performance using R [Re: GPEngine] #453363
07/22/15 15:16
07/22/15 15:16
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
Last thing, for the last point, be careful not to introduce future leakage by, say, selecting features for the 1st cycle's model based on performance the 10th cycle. wink

Last edited by GPEngine; 07/22/15 15:19.
Re: Slow backtest performance using R [Re: GPEngine] #453368
07/23/15 08:34
07/23/15 08:34
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
From our experiments so far, about 90% of the training time is for generating the models in R. This will be faster in the next Zorro update that can run several R sessions in parallel, using multiple CPU cores.

Using covariance for eliminating features is a good idea.

Re: Slow backtest performance using R [Re: jcl] #453392
07/24/15 07:33
07/24/15 07:33
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
For feature selection also look at PCA and ICA.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1