# Which algorithm should I choose for lead scoring

I am a c# senior developer and I got a task to try and predict the potential in each new client, or maybe the worth of each customer. I don't have experience with machine learning, but I played with accord-framework.net and got some nice results on simple task.

My data model for training is:

GeoLocation, // the country of ip when registed. iso code string
Age, // number
DateRegistered, //date time
Email, //string can be broken to vendors as catergorial (gmail, yahoo, microsoft and such)
EmailValidated, //is the email really exists. bool
PhoneNumber, //string
PhoneNumberValidated, // is the phone number really exists
CampaignName, //string (may be categirial)
UserAgent, //string should I make it categorial? (has info about browser, device, verndor, operation system and such, long string)
LandedOnPage, //string first url the customer entered from
RegisteredFromPage, //string url of the page that the user registered from
RefererUrl, //string url the client came to our site from,
NumberOfPurchases, //the amount of times the customer puschase something on our site
CustomerValueUsd, //the total amount of USD the customer spent in our site


The output shoud be CustomerValueUsd

I have a lot of data in the history, so I can back test it.

My questions:

1. Does it make sense to do this task even though I don't have an experience with machine learning? How complicated is this task considering I'm using a well known framework?
2. Assuming that I'm taking the task, which algorithm should I choose to perform this kind of task?
3. How should I build the training data? see my comments, do you think my comments are ok to start with? or maybe I can break the data directly?
• I suggest you take an intro to ML course. Your coding background will help a lot understanding how to turn the concepts into code. You are missing the concepts themselves, but they can be learned. One suggestion: coursera.org/learn/machine-learning – Neil Slater Nov 27 '17 at 10:16

ML is a wide and deep topic to cover.

What you need is "classification" to predict an outcome. At first, you need to convert everything to numbers (check word2vec). Then, pre-process the data (Check what is a normalization for example). Train a classifier by using any ML techniques (i.e. linear classifier, SVM, deep learning, neural classifier). Then you can use that regression function to predict further values. If you need much more detailed way to do that, it is better to buy a 'thick' book that explains all other options.

Does it make sense to do this task even though I don't have an experience with machine learning? How complicated is this task considering I'm using a well known framework?

I think it does make sense, and using an established framework would get you up and running quickly.

Assuming that I'm taking the task, which algorithm should I choose to perform this kind of task?

This is a regression problem, so I would recommend that you don't treat it as a classification task (unless you want to have a binary output like "profitable" / "non-profitable"). In essence, you are trying to identify the correlation between your inputs (previous purchases, location, etc.) and a certain metric (dollar value of the customer). Neural networks are very good at that (Accord seems to support neural networks, so you should be able to use that; TensorFlow with Keras as the interface or Caffe might be other options to consider).

How should I build the training data? see my comments, do you think my comments are ok to start with? or maybe I can break the data directly?

In most cases, you'd want to normalise your data before feeding it to the algorithm (this is particularly important for neural networks). The other thing you should do is consider what features would be relevant to the task. For example, since you want the customer value as the predicted output, the customer's phone number and email address are most probably irrelevant, but number of previous purchases, age and geolocation might be very relevant. Maybe you have other features in your database - total dollar amount of previous purchases, frequency of purchase, number of returned items or refund requests, etc. Remember to keep your model in check by splitting your data into training, validation and test sets (as a rule of thumb, 70% training / 10% validation / 20% test, but that depends on how much data you have).