0
$\begingroup$

Forgive me for my ignorance. Linked below is an image of my dataset with 1000 tuples.

https://i.stack.imgur.com/WHIlx.png

I have the following questions (1) How exactly do I go about extracting information from the Ad topic line? (2) How should I approach the categorical variables Country and City? ( I've heard about encoding but won't the large number of countries/cities be a problem?)

Thank you so much for your time. All help is greatly appreciated.

$\endgroup$
1
  • $\begingroup$ What information do you need from Ad Topic Line column? $\endgroup$
    – Leevo
    Aug 20, 2019 at 8:29

1 Answer 1

2
$\begingroup$

(1) How exactly do I go about extracting information from the Ad topic line?

The best way to deal with the test string is to Convert it into a term-document matrix and calculate the TFIDF Scores for every word in the string.

(2) How should I approach the categorical variables Country and City? ( I've heard about encoding but won't a large number of countries/cities be a problem?)

Yes you said the right large number of cities will be a problem i suggest still you can go with that, Rather there is a way find out the distribution of all your cities and cities and convert them into integers. Even another way could be give weights to the cities which are repeated most,let me give you an example:

Suppose you have 10 observations and 5 cities A(5 times),B(2 times),C(once),D(Once),E(Once):

so A will get a weight of 5/10=0.5 which B will get a weight of 2/10=0.2 and so on.

Hope this helps!

$\endgroup$
2
  • $\begingroup$ Thank you for your response! Could you please walk me through the matrix conversion and score calculation in python? $\endgroup$
    – Apollo
    Mar 23, 2019 at 15:45
  • $\begingroup$ @Apollo that should be made as another question. Please mark this as an answer if you find it helpful to you. $\endgroup$
    – Long
    Feb 5, 2020 at 5:58

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.