5
$\begingroup$

I have unsupervised data (i.e this data doesn't have any target variable through which I can learn it's prior behaviour) it is a mix of continuous and categorical data. Now I want to classify the test data into three categories on basis of my unsupervised data.

The approach I took is to first do the clustering of unsupervised data, use this categorised data as a base data for preparing a new model that predicts on top of it.

I want know whether this approach correct or not or is there better way for classifying test set? Particular algorithm I need to follow for this?

I am doing this in R.

The approach is to modify the training set data so that this can be used to properly predict the test data. Here target variable is missing in train and test set.

$\endgroup$
  • $\begingroup$ Welcome to the site. Possible to add a small chunk of your data here? (Would help in answering better) :) $\endgroup$ – Dawny33 Jun 14 '16 at 12:05
  • $\begingroup$ @Dawny33 actually this data is confidential to company and I can't copy paste here...it will be helpful if somebody can throw light on approach and algorithm for mix and unsupervised data. $\endgroup$ – Rahul Sharma Jun 15 '16 at 3:14
  • 2
    $\begingroup$ From what I understand, looks like you are on the right path. Since the data is unsupervised, I'd cluster it into natural groups first, and then use those cluster assignments as the target for predicting the test data. See here for something similar: datascience.stackexchange.com/questions/985/… $\endgroup$ – Minu Jun 15 '16 at 19:13
  • 2
    $\begingroup$ You say this is an unsupervised problem, but then you say you have "categorised data". This is contradictory; what's the task here really? $\endgroup$ – Sean Owen Jun 24 '16 at 16:26
  • 1
    $\begingroup$ @Eskapp I agree data is data but I tried to explain the property that it does not have property through which I can supervise present data with historical data. I am editing to give more clarification so other don't get confuse. $\endgroup$ – Rahul Sharma Dec 17 '16 at 14:02
1
$\begingroup$

You have many options of algorithms to use for classification of unsupervised data.

This is a very broad topic, but if you need a specific algo recommendation, try to see if self-organizing maps (SOM) may help with your specific problem. In R, try the kohonen package.

K-means is another popular clustering algorithm.

No matter which method you use, consider converting your categorical data to numerical data for clustering, as it may alleviate some of your mixed data-type woes.

| improve this answer | |
$\endgroup$
  • $\begingroup$ I'm not sure I'd call either of those "classification", but it does sound like a clustering problem. SOMs aren't really a clustering technique as much as a form of dimension reduction. $\endgroup$ – Sean Owen Jun 24 '16 at 16:27
  • $\begingroup$ That is a good point. One possibility is to build an SOM, and then cluster with k-means once the SOM is produced. $\endgroup$ – Michael Kirchner Jun 24 '16 at 16:44
  • $\begingroup$ Additionally @SeanOwen : I can't comment on his post (not enough reputation yet), however I believe by "categorised" data he did not mean the original dataset, but one produced after an initial clustering task. $\endgroup$ – Michael Kirchner Jun 24 '16 at 16:48
1
$\begingroup$

It's really a broad topic but I think you are going on a right track.

I solved a similar problem couple of months back where I worked on classification of documents in multiple categories using Centroid based algorithm. Here, I clustered training dataset using Spherical K-Means, and the resulting centroids of the clusters represented a category. Later while predicting a category of new document, I would compare the document with all the centroids and assign a category based of SSE.

| improve this answer | |
$\endgroup$
1
$\begingroup$

Michael is right - K-means clustering could possibly work for you, but K-means isn't designed to handle categorical variables.

If you don't have too many categories, then you could choose to represent them as dummy variables. Here's a link to a post where I explain dummy variables in Python Pandas. I also found a Stack Overflow answer that explains how to create dummy variables in R.

| improve this answer | |
$\endgroup$

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.