2
$\begingroup$

I am working on titanic dataset. I have one feature Pclass which I understand is an ordinal variable having values 1,2 and 3. I have created a new feature cabin_int from feature Cabin, which is essentially the number of cabins alloted to a passenger. So, it has values like 0,1,2,3 and 4. Now this new feature is not ordinal, it is just a continuous variable taking only integer values.

My question is how does Machine Learning algorithm understands the difference between the two, if I pass these two columns (Pclass and cabin_int) as they are during training of my model?

If some more feature engineering needs to be done, please tell.

$\endgroup$
1
  • 1
    $\begingroup$ The short answer is that the machine learning algorithm doesn't understand the type of your inputs, instead it is you that needs to make sure you are using an appropriate algorithm that is based on the correct assumptions about your inputs. $\endgroup$
    – user17471
    Jan 4, 2018 at 18:33

1 Answer 1

1
$\begingroup$

There is a rule called there is no free launch. It means that there isn't a learning algorithm that solves all the problems. You as a machine learning practitioner should decide when and how to use which algorithm. Suppose that you want to recognize faces. This problem is a learning problem which if you increase the number of training data, you will get better results. In these cases neural nets and deep nets are highly recommended. In this case it is not logical to use non-linear SVM because it will be so costly and you may not even get good answers. the reason is that deep nets cares about local patterns but SVM considers all the input pattern simultaneously. Actually in your case, I guess your data is categorical. For categorical data, people often use decision trees.

To illustrate an example, once I decided to train a simple MLP to distinguish whether an input pattern is in correct position, to solve 8-queen problem. I solve the game using Genetic algorithm and made data for training the net. The data I brought to net was categorical in some extant. I used it and the net was so good for the trained data, but input features similar to training data which were a bit different had bad recall rate. I trained a decision tree, I get so much better result.

Which algorithm depends on your task and your input features.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.