I have a dataset

data = { 
    points: 3.765, 
    review: `Food was great, staff was friendly`, 
    country: 'Chile', 
    designation: 'random', 
    age: 20


I am looking for a way to use these features to build a model to predict points.

Description seems to hold alot of information about points.

How do i feed this data into the model and also which model?

Note I dont want to use word2vec (embeddings)


For a simpler approach,

  1. Remove stopwords, Perform stemming and lemmatization, Create Tfidf vectors for your text or Create BagOfWords representation of your review text or you can have both as well.

  2. Making a country as a one-hot vector is not desirable as if your dataset contains all the countries in the earth, your one-hot vector would be mostly zero which increases your train and run-time complexities. Instead, calculate the distance of each country from a single point on earth. Ex: Distance of each of those countries from the equator or south pole or north pole and add it as a feature instead of a one-hot vector.

  3. Designation can be one hot vectorized if the number of unique designations is a handful. I believe there must only be a handful of designation.

  4. Age you can just past it as its already numerical


To predict the points variable, we have four features namely review, country, designation and age.

For the review feature,

You can use Doc2Vec to transform the review into a fixed size vector. Similar reviews will lie in a close vicinity.

For the country and designation features,

Assuming these variables have finite values, so you can treat the variable as categorical. We can use one-hot encoding.

For the age feature,

You can treat this variable as numeric.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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