# Predicting a Continuous output in a dataset with categories

Let's say this: I'm working on a machine learning project and I'm working on a dataset with a 4250,13 as shape and it is already grouped in 7 categories! Note that those categories can't be considered as predictor. Here is how my data is grouped in the categories feature 'FAC':

FSEG       32.852598 % of the dataset
FSTA       19.151644 % of the dataset
FD       19.003181 % of the dataset
FM      16.076352 % of the dataset
FT      5.132556 % of the dataset
PPSE       4.814422 % of the dataset
FSDC    2.969247 % of the dataset


I have a continuous output that I want to predict 'CGPA', so the task is a regression, my goal is to predict it in each category, and the final decision will be the category where the predicted output is maximized.

My approach to deal with this problem is to sample my dataset into 7 sub-datasets and train the model in all those 7 datasets. And for a new input, predict the output in each category, and the final category will be where the predicted output is maximal.

Now I want to know, is there any way to do it in one dataset and automatically predict the category where my output is max? With a single model instead of 7?

PS: I'm using python and scikit learn

Sound like random-forest but not sure that is it ... can someone help? Any help will be appreciated.

Here is my dataset with samples collected in each category. My final output is called CGPA and the category label is 'FAC'.

• You say you want to predict a continuous output for 7 categories and then choose the category with maximum output. Is your final output the category label? Do you care what the predicted output was for this or any of the other categories, or do you discard that data? Jul 24 '17 at 7:00
• I need to have different the value of the continuous output in the 7 categories and then decide the category where the output is max.. i can say that my goal is to have 7 continuous output and finally choose a category according to that final output Jul 24 '17 at 7:08
• So if I just told you what the category with the highest output is, without telling you the predicted output, that would not work? Jul 24 '17 at 7:11
• it can works and but I need to know the value of the output in each category , i can give the category to the user and sometime the final decision can be made by him, he can choose a category where the output is not max... but the ideal is to choose the category where the output is maximazed Jul 24 '17 at 7:22
• When you say your data is grouped into categories, do you mean that each row only gives the output for one category? Can you show us a few rows of your data? Jul 24 '17 at 8:25

In some languages, such as R, the regression command will automatically do this one-hot conversion for you. For python, the pandas package can do this for you with pd.get_dummies(data).