# Preparing for machine learning exam

I am preparing for a machine learning exam and I found a question on the internet ( please see below) that needs to decide which kind of machine learning algorithm are suitable for these data. Despite reading a lot, I am still not able to answer this question properly. I don't know the strategy that I should take to answer this question. By the way do you know any sources that have these kind of examples with solution that can help me to find out the right answer? highly appreciate your help in advance

A financial institution has just hired you to build a system which will decide what car insurance package to offer to different clients. The information recorded about the clients is; gender (Boolean), age group (under 20, 20-35, 35-55, over 55), occupation (one of 20 categories), credit rating (a numerical value between 0 and 20) and number of accidents in the last year, and in the last five years (as reported by the client themselves). They also record the car make, model and year, and the city where the person lives. They have a database of roughly 20000 current clients, and for each they have recorded the plan that was used, as suggested by an expert. For each of the methods below, explain whether it is appropriate to use for this type of data. If your answer is no, explain why. If your answer is yes, explain why, and how you would go about setting up the problem (input processing, output processing, choice of approximator structure etc).

• Neural network
• SVM
• Linear regression
• Polynomial regression
• Naive Bayes
• Decision trees
• k-nearest neighbor
• Logistic regression
• Please check stats.stackexchange.com/tags/self-study/info – Tim Nov 22 '16 at 8:27
• Hi Tim, Thanks! I read the wiki. I am not sure if my question goes to that categories. Because I am preparing for the exam and found this question on internet and I want to know how I can address ... – siban sargo Nov 22 '16 at 8:33
• @siban "Answering a bookwork-style question I found somewhere while studying for an exam" definitely counts as self-study for our purposes. Previous versions of the wiki were a bit more inclusive in their language, but tag wikis are intended as brief summaries not legal documents. If it would resolve things for you, I could edit the tag wiki to insert "including but not limited to" before the examples of what a self study question is. – Glen_b Nov 23 '16 at 3:23
• I wish there was a website to help you prepare for machine learning exams. An idea like Digital Aristotle needs to be in practice. – technazi Oct 31 '17 at 2:51

The answer is that All of the methods can be used for the above problem.

Well, two things should be noted in these kinds of simple problems.

1. Is it a classification or a regression problem? You might have already guessed that it is a classification problem.

2. Are there any categorical values in the input features? If yes, does the chosen algorithm work with categorical variables.

The examiner may expect the answer that neural networks, SVM etc. don't work with categorical variables. But in fact you can encode a categorical variable as a series of binary variables. For example if the variable age group takes values {child, young, old}, then you may change this single variable to three binary variables; is_child, is_young and is_old. This way you can use svm or neural network.

Again linear regression looks like an unlikely candidate for a classification problem. But they can be used for classification as well. You don't expect any mentionable performance though.

This is not a very well posed question since the answer is potentially all of the algorithms. This question can easily lead to disputes with the professor about what you were supposed to know and answer based on the lectures vs. what you can find in the scientific literature.

In addition to Binu Jasim's points:

SVMs can do only binary classification out of the box. Here you have multiple classes. I would therefore not recommend SVM, they would need to be run multiple times in a one vs. all or one vs. one scenario.

Like neural networks, decision trees can require to convert categorical variables into binaries. It depends on the type of tree, but this preparation would be very easy anyway.