# How to predict product price range using machine learning algorithms

I would like to run thru regression algorithms(linear, SVM, Random forest, Xgboost) thru historical data to predict the price range of a product.

To get the price range am going to use top predict value as upper bound and next best value as lower bound).

Ex: Product a price range preicttion - $$1000 to$$5000.

$$5000 is from top predicted price.$$1000 is from next best-predicted price.


Is my approach correct?

Yet to receive data, so do not have much data sample to provide.

If in your dataset you have two columns for the minimum and maximum value as columns n-1 and n, you can train the dataset for n-1 columns, where n-1th column is your dependent value, then for predicting nth column, the nth column would be your dependent value and n-1 others independent.

It is not very clear from your question what you are looking at. I assume you will have data like,

feature 1, feature 2, ..., feature n, price (multiple entries like this)


Now you would want to train this data to train a model to predict price. price is your output variable and features are input variables. Once you train your model, use some test data (where you know the price) to see what is the predicted price. And see how good/bad are predictions compared to actual values.

Not sure why you need top price and next best price.

I believe that you are expecting two outcomes from your model,

 1. Minimum price
2. Maximum price


Assuming your training data set have two Labels i.e. min price and max price. If so, in my opinion you should train two separate regression model, 1. Keep Minimum price Label as the target and rest as an feature. 2. Keep Maximum price Label as the target and rest as an feature.

And in case your training data has just single Label i.e. only Price. In such a case, according to me you can put some threshold value and it will work as a Variance in price.

• Vipin Bansal- Assume I have only price columns as a target variable, in that case, the threshold price(how to determine ?) would be treated as minimum price and variance in price(the difference between threshould value and the highest predicted value of a product) as Max price. Is that correct? – Optimizor May 20 '19 at 5:36
• You can group your datset in to multiple clusters, say based upon the no. of rooms, location, amenities etc. Once it's done identify the price range and standard deviation for each cluster and save it somewhere. For your new sample(to be predict) identify the closet cluster and use its SD as price variance on newly predicted value. – vipin bansal May 21 '19 at 1:59
• Another thing you can do is, while testing your trained model, identify the price variance. Take the average of this value and use it as SD in newly predicted sample. – vipin bansal May 21 '19 at 2:02