Machine learning in trading: theory, models, practice and algo-trading - page 2208

 
Valeriy Yastremskiy:

that link I gave on the wiki about the semi. I understood the marks are the edges of the stable sections.

ZZ does not go, because marking just goes without differences of sites, and learning goes the same way, and if by labels ZZ it is like too many examples with different features and the result of learning can not be good.

Labels are known target\classes. The rest of the data without them, just in the form of traits

These labels are supposed to carry some meaning. For example, labels that are cats or crocodiles

in our case we have no idea where the cats are. I.e. we don't know any patterns and how they differ, this makes it even more difficult

so the initial marking of labels can bruteforce, go through the variants

 
Maxim Dmitrievsky:

are just the known target classes. The rest of the data without them.

It's like setting the right search direction.))

Maxim Dmitrievsky:


These labels are supposed to carry some meaning. For example, tags that it's cats or crocodiles

In our case, we have no idea where the cats are. That is, we do not know any patterns and how they differ, this further complicates the task

so we can bruteforce the initial markings, go through the variants.

Full bruteforcing is always better than incomplete bruteforcing. The point about not full correct markup has always been there. And the curse of dimensionality is only solved by getting the search direction right. It's a question of finding / determining a good area to search for variants.

 

I tried to extend the idea of acceptability of small samples for GMM. Train 6 months, test 5 years. I split tags into n parts of fixed size. For each part I created my own GMM model, generated 1000 samples from each, piled them up and trained the catbust. I picked up the features and got like this:

Iteration:  0 R^2:  0.9209352881222573
Iteration:  1 R^2:  0.9379233716807497
Iteration:  2 R^2:  0.94604683760217
Iteration:  3 R^2:  0.9316240202095838
Iteration:  4 R^2:  0.8813998843225924
Iteration:  5 R^2:  0.8820262895230507
Iteration:  6 R^2:  0.9068275822699385
Iteration:  7 R^2:  0.9335383124164518
Iteration:  8 R^2:  0.8960336270368543
Iteration:  9 R^2:  0.8879176417296292
Iteration:  10 R^2:  0.9143324457906077
Iteration:  11 R^2:  0.9468819523130443
Iteration:  12 R^2:  0.9058317279184074
Iteration:  13 R^2:  0.9169237743824633
Iteration:  14 R^2:  0.9004312808918618
Iteration:  15 R^2:  0.8914705535825033
Iteration:  16 R^2:  0.9303813779412192
Iteration:  17 R^2:  0.9207720444742649
Iteration:  18 R^2:  0.9508313124156939
Iteration:  19 R^2:  0.9365410846386889
Iteration:  20 R^2:  0.9227862991881809
Iteration:  21 R^2:  0.9052003797596105
Iteration:  22 R^2:  0.8975861474045481
Iteration:  23 R^2:  0.9431936051970786
Iteration:  24 R^2:  0.9147205226323929
Iteration:  25 R^2:  0.9476544304761072
Iteration:  26 R^2:  0.9333016398932669
Iteration:  27 R^2:  0.9076751168791403
Iteration:  28 R^2:  0.8697156778100353
Iteration:  29 R^2:  0.8845935705960335
Iteration:  30 R^2:  0.9159489461919911
Iteration:  31 R^2:  0.9232528133285296
Iteration:  32 R^2:  0.9465969161207943
Iteration:  33 R^2:  0.923873107775384
Iteration:  34 R^2:  0.887118901781171
Iteration:  35 R^2:  0.9077338861211618
Iteration:  36 R^2:  0.9174686253027636
Iteration:  37 R^2:  0.9293399179092457
Iteration:  38 R^2:  0.8978226916069179
Iteration:  39 R^2:  0.927290878522851
Iteration:  40 R^2:  0.9030239602884128
Iteration:  41 R^2:  0.9621423075912642
Iteration:  42 R^2:  0.9311707303177966
Iteration:  43 R^2:  0.8710910233452236
Iteration:  44 R^2:  0.9103469394662375
Iteration:  45 R^2:  0.8919753688513302
Iteration:  46 R^2:  0.948991254496016
Iteration:  47 R^2:  0.9052353780393834
Iteration:  48 R^2:  0.9512288525623317
Iteration:  49 R^2:  0.9208453469280165
Iteration:  50 R^2:  0.893737366120048
Iteration:  51 R^2:  0.928125477787328
Iteration:  52 R^2:  0.8942972434275139
Iteration:  53 R^2:  0.9199962696797981
Iteration:  54 R^2:  0.915636353356246
Iteration:  55 R^2:  0.8985519043156066
Iteration:  56 R^2:  0.9347755921190894
Iteration:  57 R^2:  0.9584552730083282
Iteration:  58 R^2:  0.9032314235396457
Iteration:  59 R^2:  0.9054094988875886
Iteration:  60 R^2:  0.9297272696445005
Iteration:  61 R^2:  0.9115802884108607
Iteration:  62 R^2:  0.9413266801702871
Iteration:  63 R^2:  0.8828780223711544
Iteration:  64 R^2:  0.8824525390982221
Iteration:  65 R^2:  0.9053951498492597
Iteration:  66 R^2:  0.8714355206255209
Iteration:  67 R^2:  0.918076158247141
Iteration:  68 R^2:  0.8364078585625844
Iteration:  69 R^2:  0.9105699936970394
Iteration:  70 R^2:  0.8964063526272564
Iteration:  71 R^2:  0.9167952116250836
Iteration:  72 R^2:  0.8755502709003292
Iteration:  73 R^2:  0.9386759877643626
Iteration:  74 R^2:  0.9111343213701268
Iteration:  75 R^2:  0.9316337347065893
Iteration:  76 R^2:  0.9491318658912862
Iteration:  77 R^2:  0.8793801507135458
Iteration:  78 R^2:  0.88457680290715
Iteration:  79 R^2:  0.9320128938747305
Iteration:  80 R^2:  0.8718850318456811
Iteration:  81 R^2:  0.9435554177361902
Iteration:  82 R^2:  0.9203305196370429
Iteration:  83 R^2:  0.9260245682457562
Iteration:  84 R^2:  0.9049805884830662
Iteration:  85 R^2:  0.9623136916438867
Iteration:  86 R^2:  0.9489381651270304
Iteration:  87 R^2:  0.9185761083088367
Iteration:  88 R^2:  0.9300874485193825
Iteration:  89 R^2:  0.9270368671164058
Iteration:  90 R^2:  0.89171822598241
Iteration:  91 R^2:  0.9442365127017215
Iteration:  92 R^2:  0.9147433442119735
Iteration:  93 R^2:  0.9466461518946063
Iteration:  94 R^2:  0.8985030583949476
Iteration:  95 R^2:  0.9227935867673295
Iteration:  96 R^2:  0.9270658994573892
Iteration:  97 R^2:  0.8861414609105617
Iteration:  98 R^2:  0.9069299245110212
Iteration:  99 R^2:  0.9381808829667341

Second version, same labels, with the same partitioning, but with pre-mixing:

X = X.sample(frac=1.0)
Iteration:  0 R^2:  -0.9147922986362467
Iteration:  1 R^2:  -0.8891349235839455
Iteration:  2 R^2:  -0.7756433696750841
Iteration:  3 R^2:  -0.9294701419803408
Iteration:  4 R^2:  -0.8675029639731144
Iteration:  5 R^2:  -0.9333665101462129
Iteration:  6 R^2:  -0.7215820820380785
Iteration:  7 R^2:  -0.835634878720925
Iteration:  8 R^2:  -0.8982572730634232
Iteration:  9 R^2:  -0.8433406526089088
Iteration:  10 R^2:  -0.8905214289474265
Iteration:  11 R^2:  -0.9523382605378116
Iteration:  12 R^2:  -0.9353234698827787
Iteration:  13 R^2:  -0.9255519745316118
Iteration:  14 R^2:  -0.8961044791463404
Iteration:  15 R^2:  -0.8720720502698673
Iteration:  16 R^2:  -0.7673961693909795
Iteration:  17 R^2:  -0.9178099795704201
Iteration:  18 R^2:  -0.8028458725344336
Iteration:  19 R^2:  -0.9171290688719891
Iteration:  20 R^2:  -0.8315941217013689
Iteration:  21 R^2:  -0.5070548765483025
Iteration:  22 R^2:  -0.8116346823881794
Iteration:  23 R^2:  -0.8640716653285909
Iteration:  24 R^2:  -0.8410638452155568
Iteration:  25 R^2:  -0.8840402609492392
Iteration:  26 R^2:  -0.8499245238176002
Iteration:  27 R^2:  -0.8778289064553249
Iteration:  28 R^2:  -0.9268702558814643
Iteration:  29 R^2:  -0.8925221189558847
Iteration:  30 R^2:  -0.9657842200006661
Iteration:  31 R^2:  -0.77464827311577
Iteration:  32 R^2:  -0.6464089792356508
Iteration:  33 R^2:  -0.7362468345293623
Iteration:  34 R^2:  -0.8359119411978162
Iteration:  35 R^2:  -0.8953980020172865
Iteration:  36 R^2:  -0.9643167791133879
Iteration:  37 R^2:  -0.9200720117785897
Iteration:  38 R^2:  -0.4930038499649341
Iteration:  39 R^2:  -0.8563412086058743
Iteration:  40 R^2:  -0.7534658472329049
Iteration:  41 R^2:  -0.9058712268796619
Iteration:  42 R^2:  -0.8404352444846342
Iteration:  43 R^2:  -0.8956393865296916
Iteration:  44 R^2:  -0.7697676598374891
Iteration:  45 R^2:  -0.827402321523272
Iteration:  46 R^2:  -0.7733648036339182
Iteration:  47 R^2:  -0.9094911321363413
Iteration:  48 R^2:  -0.8112209852571995
Iteration:  49 R^2:  -0.9272815570481083
Iteration:  50 R^2:  -0.9516373600713565
Iteration:  51 R^2:  -0.923161311310859
Iteration:  52 R^2:  -0.9454357553057322
Iteration:  53 R^2:  -0.8874717694423527
Iteration:  54 R^2:  -0.9442569831498039
Iteration:  55 R^2:  -0.8509749828624672
Iteration:  56 R^2:  -0.8880233388858068
Iteration:  57 R^2:  -0.829081492806442
Iteration:  58 R^2:  -0.8104288788378895
Iteration:  59 R^2:  -0.9461212586368714
Iteration:  60 R^2:  -0.9638585005999462
Iteration:  61 R^2:  -0.9331377065042211
Iteration:  62 R^2:  -0.9273729445871957
Iteration:  63 R^2:  -0.9087582575118714
Iteration:  64 R^2:  -0.9413841949907823
Iteration:  65 R^2:  -0.9322001763523151
Iteration:  66 R^2:  -0.7762699813649556
Iteration:  67 R^2:  -0.8157764341998059
Iteration:  68 R^2:  -0.8553516949784419
Iteration:  69 R^2:  -0.8892466719564891
Iteration:  70 R^2:  -0.927962172458
Iteration:  71 R^2:  -0.9155014169139781
Iteration:  72 R^2:  -0.813270189921209
Iteration:  73 R^2:  -0.8906455890506758
Iteration:  74 R^2:  -0.8515052662862699
Iteration:  75 R^2:  -0.7464436838057231
Iteration:  76 R^2:  -0.9265461731236329
Iteration:  77 R^2:  -0.9097917153476209
Iteration:  78 R^2:  -0.9320352532410676
Iteration:  79 R^2:  -0.9136167627146698
Iteration:  80 R^2:  -0.9058376874038158
Iteration:  81 R^2:  -0.9218661728537026
Iteration:  82 R^2:  -0.8761532667040411
Iteration:  83 R^2:  -0.8613901314137971
Iteration:  84 R^2:  -0.9549329316806329
Iteration:  85 R^2:  -0.9369577646891263
Iteration:  86 R^2:  -0.9088532629673239
Iteration:  87 R^2:  -0.913690880309502
Iteration:  88 R^2:  -0.9380433297279352
Iteration:  89 R^2:  -0.9022452839070761
Iteration:  90 R^2:  -0.8628005914827953
Iteration:  91 R^2:  -0.6997900178668703
Iteration:  92 R^2:  -0.9236900047877985
Iteration:  93 R^2:  -0.7743753260702735
Iteration:  94 R^2:  -0.8915162635095815
Iteration:  95 R^2:  -0.9238512868243697
Iteration:  96 R^2:  -0.7885755415193383
Iteration:  97 R^2:  -0.8691156336449682
Iteration:  98 R^2:  -0.8358956414656111
Iteration:  99 R^2:  -0.9681215417714616

One fixed target was used in both cases. I can reproduce this experiment if you wish. I am not strong in the interpretation of such phenomena, perhaps there is an explanation.

 
welimorn:

I tried to extend the idea of acceptability of small samples for GMM. Train 6 months, test 5 years. I split tags into n parts of fixed size. For each part I created my own GMM model, generated 1000 samples from each, piled them up and trained the catbust. I picked up the features and got like this:

Second version, same labels, with the same partitioning, but with pre-mixing:

One fixed target was used in both cases. I can reproduce this experiment if you wish. I am not strong in the interpretation of such phenomena, perhaps there is an explanation.

Is this mixing before gmm or before boost? You should check the class balance for traine/test. Maybe zeros went to traine and ones to test. You could also try separate clustering by buy and sell marks.
 

Sorry, guys, there's a question.

What is the number of weighting ratios in your grids, and how many trades are being trained on?

I want to understand the relationship between those numbers and speculate on the dependence of overtraining on that relationship. Thank you.

 
Maxim Dmitrievsky:
Is this mixing before the gmm or before the boost? You need to check the class balance for traine/test. Maybe zeros went to traine and ones to test. You could also try separate clustering by buy and sell marks.

Mixing is done before creating GMM.

Before that I drop labels by condition:

dataset['labels'].loc[dataset['labels'].diff(1) == 0] = np.nan


dataset = dataset.dropna()

this always brings the class balance to 1/1 with slight variations:

count labels 0 before GMM: 57
count labels 1 before GMM: 58

In this case, 115 tags were shuffled, and divided into 4 parts. Then 4 GMM models were created based on them. From each, 1000 labels are sampled and they are combined into one dataframe. After that it was split into trace and test.

The balance of samples classes in this case was a little different from the ideal. But the samples of the train and the test had approximately the same ratio

count labels train before train_test_split  lab0/lab1 2006/1994
count labels train before CatBoost lab0/lab1  972/1028
count labels test before CatBoost lab0/lab1  1034/966
Iteration:  0 R^2:  -0.09193595558595069

count labels train before train_test_split  lab0/lab1 1956/2044
count labels train before CatBoost lab0/lab1  968/1032
count labels test before CatBoost lab0/lab1  988/1012
Iteration:  1 R^2:  0.2187933983460144

count labels train before train_test_split  lab0/lab1 1937/2063
count labels train before CatBoost lab0/lab1  968/1032
count labels test before CatBoost lab0/lab1  969/1031
Iteration:  2 R^2:  0.07935341972355503

count labels train before train_test_split  lab0/lab1 2004/1996
count labels train before CatBoost lab0/lab1  1006/994
count labels test before CatBoost lab0/lab1  998/1002
Iteration:  3 R^2:  0.5243959241368454

count labels train before train_test_split  lab0/lab1 2002/1998
count labels train before CatBoost lab0/lab1  999/1001
count labels test before CatBoost lab0/lab1  1003/997
Iteration:  4 R^2:  -0.11495440249539668

count labels train before train_test_split  lab0/lab1 2034/1966
count labels train before CatBoost lab0/lab1  1016/984
count labels test before CatBoost lab0/lab1  1018/982
Iteration:  5 R^2:  -0.2007764868672567

...

Below are the simulation results with the same sample of 115 tags split into 4 parts, but without mixing. The balance of classes, of course, a little better, but I think it does not significantly affect the result.

count labels train before train_test_split  lab0/lab1 2012/1988
count labels train before CatBoost lab0/lab1  1008/992
count labels test before CatBoost lab0/lab1  1004/996
Iteration:  0 R^2:  0.6604621522811843

count labels train before train_test_split  lab0/lab1 1978/2022
count labels train before CatBoost lab0/lab1  1003/997
count labels test before CatBoost lab0/lab1  975/1025
Iteration:  1 R^2:  0.9280130097632814

count labels train before train_test_split  lab0/lab1 2024/1976
count labels train before CatBoost lab0/lab1  1031/969
count labels test before CatBoost lab0/lab1  993/1007
Iteration:  2 R^2:  0.8262169779783981

count labels train before train_test_split  lab0/lab1 1980/2020
count labels train before CatBoost lab0/lab1  1010/990
count labels test before CatBoost lab0/lab1  970/1030
Iteration:  3 R^2:  0.9348696093090818

count labels train before train_test_split  lab0/lab1 2030/1970
count labels train before CatBoost lab0/lab1  1016/984
count labels test before CatBoost lab0/lab1  1014/986
Iteration:  4 R^2:  0.5284975351783288

count labels train before train_test_split  lab0/lab1 2042/1958
count labels train before CatBoost lab0/lab1  1024/976
count labels test before CatBoost lab0/lab1  1018/982
Iteration:  5 R^2:  0.9246045699747673

...

This may sound silly, but it seems to me that there is some kind of time correlation in the series that GMM models find in different parts of the series. It disappears if you break the ordering by shuffling the row.

I didn't think about separate clustering, I'll try it tonight.

 
Сбербанк запустил сервис постановки диагноза с помощью нейросетей
Сбербанк запустил сервис постановки диагноза с помощью нейросетей
  • 2020.12.02
  • РБК
  • www.rbc.ru
Сбербанк запустил сервис, в котором диагноз по описанным пациентами симптомам будет ставить искусственный интеллект. Цифровая медицина — перспективное направление, но эксперты пока видят очень много рисков в «лечении» нейросетями Входящие в группу Сбербанка компании — «СберЗдоровье», «СберМед ИИ» и «Лаборатория по искусственному интеллекту» —...
 

Stirring is done before creating the GMM.

Before that I drop labels by condition:

this always brings the class balance to 1/1 with slight variations:

In this case, 115 labels were shuffled, and divided into 4 parts. Then 4 GMM models were created based on them. From each, 1000 labels are sampled and they are combined into one dataframe. After that it was split into trace and test.

The balance of samples classes in this case was a little different from the ideal. But the samples of the train and the test had approximately the same ratio

Below are the simulation results with the same sample of 115 tags split into 4 parts, but without mixing. The balance of classes, of course, a little better, but I think it does not significantly affect the result.

This may sound silly, but it seems to me that there is some kind of time correlation in the series that GMM models find in different parts of the series. It disappears if you break the ordering by shuffling the row.

I hadn't thought about separate clustering, I'll try it tonight.

I'll have to draw it, it's not very clear... Well, the fact that the distributions are different in both cases. Plus you have already removed the serialization. Most likely the distributions are heavily uninformative, and the new points after sampling start to lie in the middle of nowhere. I.e. the information in the series is lost, yes, since the quotes are not independent.

Or do on some simple example (not quotes) and compare then.

 
Maxim Dmitrievsky:

I'll have to draw, it's not very clear... Well, the fact that the distributions are different in both cases is a fact. Plus you have already removed the seriality. Most likely, the distributions are very uninformative, and the new points after sampling start to lie in an incomprehensible place. I.e. the information in the series is lost, yes, since the quotes are not independent.

Or do it on some simple example (not quotes) and compare then.

Maxim, hi. It's been a long time since I came here... I may be interested in your article) I have installed Python) I should understand it and have lots of questions))) I take it MARKUP is a spread? Markup is a simple comparison of current value with the current + a random number, depending on the sign > or < you put a markup 1 or 0. right? For the test, you set markup=0.0? (if the tray MARKUP=0.00001)) right?

 
Alexander Alekseyevich:

Maxim, hi. It's been a long time since I came here... It's about your last article) I have installed Python) I'm trying to understand it, and I have a lot of questions))) I take it MARKUP is a spread? Markup is a simple comparison of current value with the current + a random number, depending on the sign > or < you put a markup 1 or 0. right? For a test, you put markup=0.0? ( I think it's MARKUP=0.00001)) right?

Hi. Yes, that's right. The same markup is used in the tester. About articles is probably better to ask in the articles. That in one place was

I analyze the feedback and see what can be improved