Get viewer information with Keras and TensorFlow

I recently discovered Keras and TensorFlow , and I'm trying to get into ML. I manually classified trip and test data from my user database as follows:

9 functions and a label, functions are events in my system, such as “user added profile picture” or “user paid X for a service”, and the label is positive or negative. ROI (1 or 0)

Example:
enter image description here

I used the following code to classify 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 an accuracy of 89%. This works great to designate a user as a valuable customer.

Q : How can I extract features that contributed to a possible ROI so that I can increase their orientation in UX?

Or . What is the approach to find the best combined audience segment?

+5
source share
1 answer

As people say, there is no easy answer, and mine is not meant to be answered , but I think you can try something like this.

Take a look at the approach:

  • Predict Results for All Your Customers
  • Filter out good customers and display their features.
  • Filter out bad customers and display their features.
  • Do you see the obvious picture? Example: most failures do not have an x ​​function.

Create fake clients with combined features:

  • First, create fake clients that have only one function, from 1 to 9. (Client 1 has only function 1, client 2 has only function 2, etc.)

  • Predict results for these customers.

  • Make sure that any of the functions gives good results (this may not be a real result, but pay attention)

You can see the result of each function above, but this is unlikely, right?

  • Now you can create all combinations of two functions. There are 36 combinations (9 x 8/2) of these features. (F1 / F2; F1 / F3; F1 / F4 ....)
  • Predict and look at good customers (pay attention to the best combinations)

Continue driving, combinations of 3 functions (84 combinations)
Combinations of 4 functions (126 combinations)

Compare the results between each step above :

  • Take all customers with failures with four functions. Comparison with successful customers with 1 function: is this the only function of success present in failed customers? If not, you probably found an independent success function.

  • Any function missing in all candidates for failure of all tests? This is another independent function of success.

Similar to the first, you can compare 4 function failures with 2 successes and see if any pair of functions has been successfully implemented.

And so on.

Take real customers and filter them, given the above results:

  • From real customers, take all those who have the only function that you consider successful. Confirm that they are truly successful.
  • Do the same with real customers who have pairs of features that you think are successful. Confirm if there are any.

You can take the same approach, assuming that certain functions may crash, not succeed. Or instead of looking at the current functions, look at the missing functions, etc.

+2
source

Source: https://habr.com/ru/post/1268544/


All Articles