MetaTrader 5 Python User Group - how to use Python in Metatrader - page 82

 
Vladimir Karputov:

How do I make an offset?

This is the table (Data Frame)

how to make it like this:

For what? Just print it out?

 
Vladimir Karputov:

How do I make an offset?

This is the table (Data Frame)

How to make it like this:

Here, foundpandas.DataFrame.shift

The main thing is not to forget to delete the last line, as it will contain rubbish.

 
I am wildly sorry) I would like to know if it is possible to push the keyboard through python in MQL5? no time to experiment at all
 
Quite an informative thread on python integration into mt5... Why when I add my python script in mt5 terminal it is added then immediately removed?
 

Dear Sirs, please advise me on what is wrong with my understanding.

I have built a neural network. Prepared the data.

(10452, 50) (10452, 2)  полный набор данных
(7316, 50) (7316, 2)    тренировочный набор
(3136, 50) (3136, 2)    тестовый набор

Trained it.

Параметры модели:
clf__epochs = 66
clf__layers
> Размерность слоёв:
>>> Входной слой = 50
>>>>>> Скрытых слоёв -- 2
>>>>>>>> 1-й слой    = 25
>>> >> слой имеет dropout = 0.3
>>>>>>>> 2-й слой    = 12
>>> Выходной слой    = 2
clf__loss = BCE
clf__metric = accuracy
clf__optimizer = adam

Result.

Score on train data is 0.9672635197639465
Score on test data is  0.9674744606018066

#  Оцениваем на тестовых данных
test loss, test acc: [0.1585625737373318, 0.96747446]

And then I don't understand what happens...

predictions = model.predict(X_test[:15])

.

predictions[:15] =  
[[0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]
 [0.03263587 0.03311919]]

Why such "prediction" results? Expected either 0-0, 0-1 or 1-0....

 

It's always like this...

When you ask a question, everyone thinks: why bother?

Subjective opinion: 93% of the time you have to google.... 90% of the time it takes to get the question right....

Thanks for the feedback! That's all for now. I'm going to google....

 

these are the probabilities of classes 1 and 2

2nd has a higher probability, so it's predicted

their sum must be 1, there is some kind of training error here

It should output 1 neuron if it is binary classification. Or softmax
 
Maxim Dmitrievsky:

these are the probabilities of classes 1 and 2

2nd has a higher probability, so it's predicted

their sum should equal 1, there is some kind of training error here

You need 1 neuron per output if it's a binary classification. Or softmax

Binary classification does not imply 1 neuron per output. At least from what I've found...

But the problem is, the picture doesn't change when using other loss functions either!

I'll write a data tester tomorrow with prediction validation. But something tells me the result will be deplorable!

I just can't understand why the "accuracy" is over 96% and the prediction is "like this"...

Maybe I'm doing something wrong?

 
Сергей Таболин:

Binary classification does not imply 1 neuron per output. At least from what I've found...

But the problem is that the picture doesn't change when using other loss functions either!

I'll write a data tester tomorrow with prediction validation. But something tells me the result will be deplorable!

I just can't understand why the "accuracy" is over 96% and the prediction is "like this"...

Maybe I'm doing something wrong?

I guess I have no idea what kind of network constructor it is.

1 neuron does not imply, but an adder should stand and an activation f-e. Usually you put 1 neuron

there may be many reasons. For example, the data is not normalised, not properly prepared, the network is crooked
 
Maxim Dmitrievsky:

I guess I have no idea what kind of network constructor it is.

1 neuron does not imply, but an adder must be in place and an activation f-e. It's usually 1 neuron.

There may be many reasons. For example, the data is not normalised, not properly prepared, the network is not built correctly

The problem is that normalization is a lost cause!

Let me explain. There are some data A, B, C...

They are different in terms of significance and so on. Everybody (google) says that normalization should be done by columns (A-A-A, B-B-B, C-C-C) and not by rows. This is logically understandable.

But when new data appears for "prediction" HOW to normalize it if it's only ONE row? And any term in that row can go beyond normalisation on training and test data?

And normalization by strings has no effect!

Actually, already after checking these nuances, I had this "cry of the soul" ))))

Reason: