I would like to predict the relationship between two independent variables and a dependent one (model1):

x1 + x2 = y

Now, x1 is a sequence of vectors (a document composed of a sequence-of-sentences) and x2 is just a binary variable. y is also binary.

In the end I would like to compare this model to another simplified version of the model (model2):

x1 = y

To compare which model is better, I would like to use the F-Score.

I use python Keras to see how well my model1 works:

input  = Input(shape=(sentences_per_doc, maximum_sequence_length))
lstm_out = Bidirectional(LSTM(50, activation='tanh', return_sequences=True))(input  )
sent_dense = Dense(100, activation='relu', name='sent_dense')(lstm_out) 
sent_drop = Dropout(0.5,name='sent_dropout')(sent_dense)
prediction = Dense(1, activation='softmax',name='output')(sent_drop)

But since the Input to my model1 is a vector-sequence, how do I add binary variable x2 to my model to get model2?

I considered adding the binary variable to each sequence-vector (e.g. seq_vec=[1,2,3,4] + binary_x2_i=[1] = new_seq=[1,2,3,4,1]) but I dont know if this makes sense.. cause each sample i then contains binary_x2_i

Pls, add some thougth to this, thanks!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.