Get audiences insights using Keras and TensorFlow

Viewed 283

Recently I've discovered Keras and TensorFlow and I'm trying to get into ML. I have manually classified train and test data from my users DB like so:

9 features and a label, the features are events in my system like "user added a profile picture" or "user paid X for a service" and the label is positive or negative R.O.I (1 or 0)

Sample:
enter image description here

I have used the following code to classify the users:

import numpy as np
from keras.layers import Dense
from keras.models import Sequential

train_data = np.loadtxt("train.csv", delimiter=",", skiprows=1)
test_data = np.loadtxt("test.csv", delimiter=",", skiprows=1)

X_train = train_data[:, 0:9]
Y_train = train_data[:, 9]

X_test = test_data[:, 0:9]
Y_test = test_data[:, 9]

model = Sequential()
model.add(Dense(8, input_dim=9, activation='relu'))
model.add(Dense(6, activation='relu'))
model.add(Dense(3, activation='relu'))
model.add(Dense(1, activation='sigmoid'))

# Compile model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])

# Fit the model
model.fit(X_train, Y_train, epochs=12000, batch_size=10)

# evaluate the model
scores = model.evaluate(X_test, Y_test)
print("\n\n\nResults: %s: %.2f%%" % (model.metrics_names[1], scores[1]*100))

And got a 89% accuracy. That worked great in order to label a user as a valued customer.

Q : How can I extract the features that contributed for the possitive R.O.I so I can boost their focus in the UX?

Or : What is the approach to find the best combined segment of audiences?

1 Answers
Related