I have a labeled dataset composed of 3000 data. Its single feature is the price of the house and its label is the number of bedrooms.
Which classifier would be a good choice to classify these data?
Artificial Intelligence Stack Exchange is a question and answer site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment. It only takes a minute to sign up.Sign up to join this community
It is not really a metter of what model, but if it is possible at all to predict what you're trying to predict. Let's take a similar dataset from kaggle: California Housing Prices
This dataset contains house prices and other information among which the number of bedrooms per house. As suggested by Oliver in the comments we can compute the Person coefficient to estimate the correlation between the two variables.
import pandas as pd from scipy.stats import pearsonr df = pd.read_csv('housing.csv') df = df.apply(lambda row: row[df['total_bedrooms'] <= 20]) # select subset of dataframe for sake of clarity df.dropna(inplace=True) x = df['median_house_value'] # our single feature y = df['total_bedrooms'] # target labels print('Correlation: \n', pearsonr(x,y))
>>Correlation: >>(-0.14015312664251944, 0.12362969210761204)
The correlation is pretty low, which means that the price and number of bedrooms are basically not related. We can also plot the points to check that indeed there is no correlation at all.
Training a model to predict the number of bedrooms uniquely from the price would mean to find a function that can interpolate all those points, which is an impossible task since we have several different prices for houses with the same amount of bedrooms.
The only way to tackle a problem like this would be to expand the dimensionality of the data, for example by using a Support Vector Machine with a non linear kernel. But even with non linear kernels you can't do miracles, so if you're dataset looks like this one, the only solution would be to expand your dataset to include extra features.
Classification can be performed on structured or unstructured data. Classification is a technique where we categorize data into a given number of classes.
Based on my project in price classification, when i compared into the 5 models, i got a higher score on a Random Forest Classifier compared to Decision Tree, SVM, Naive Bayes, Logistic Regression.
If your data is labeled, but you only have a limited amount, you should use a classifier with high bias (for example, Naive Bayes). I'm guessing this is because a higher-bias classifier will have lower variance, which is good because of the small amount of data