Update: See bottom of question for insight into the real application which this small example is attempting to simplify.
Questin: In the different machine learning libraries, what kind of model suits the following problem? Here's a simplified version:
The algorithmic connection (which the model will hopefully learn) between X and y is as follows:
If X[i][0] != X[i][2] ----------------> y[i] is 0
If X[i][0] == X[i][2] ----------------> y[i] is 10
If X[i][0] == X[i][1] == X[i][2] -----> y[i] doubles (to 20 in this simplified example)
I've had some success with categorical outputs; in this example there are three output categories "0", "10", or "20".
In that case the model looked something like this:
inputs = keras.Input(shape=(3,), name="input")
x = keras.regularizers.l1_l2(0.01)
x = layers.Dense(64, activation="relu", name="dense_1")(inputs)
outputs = layers.Dense(3, activation="sigmoid", name="predictions")(x)
model = keras.Model(inputs=inputs, outputs=outputs)
x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=.2)
y_train = keras.utils.to_categorical(y_train, 3)
y_test = keras.utils.to_categorical(y_test, 3)
model.compile(
optimizer=keras.optimizers.Nadam(),
loss=keras.losses.BinaryCrossentropy(),
metrics=[keras.metrics.BinaryAccuracy()],
)
history = model.fit(
x_train,
y_train,
batch_size=16,
epochs=50)
But if the relationship between X
and y
is more complex e.g. there are 100 different outputs, would it still be advisable to use categorical output?
Update 1: More realistic example to illustrate the actual problem?
Putting together two users user1
(blue), user2
(pink) and a conversation starter question question1
(yellow): Assume the more similar the users are in profile, the higher the satisfaction-score of the conversation (y), and also if the question matches the users the score goes up (doubles in the simple example, y = y*2).
I posted a more realistic version of the problem here on Cross Validated some days ago. I hope it sheds light on the type of problem, and helps identify the right ML-approach given real data from users, questions and their conversations.
The goal of the real-world application is to understand which conversation starter questions fit to which user combinations. Real world conversation satisfaction could be the length of the conversation following a conversation starter question.
So we would like to predict: What conversation starter question should be asked given the two users who are about to talk.
preprocessing.StandardScaler()
fromscikitlearn
on this problem? I'm quite new to Machine Learning and perhaps I stumbled on a clumsy way of achieving results? $\endgroup$