3
$\begingroup$

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?

$\endgroup$
  • 1
    $\begingroup$ A simple correlation coefficient? $\endgroup$ – Oliver Mason Apr 12 at 12:06
  • $\begingroup$ Have you plotted and visualized your data already? A simple linear regresión might do $\endgroup$ – MikeKatz45 Apr 14 at 1:23
2
$\begingroup$

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))

Out:

>>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.

df.plot(x='total_bedrooms',y='median_house_value',kind='scatter')

Out:

enter image description here

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.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thanks for your explanation, I think you're right. $\endgroup$ – Arashsyh Apr 14 at 7:22
1
$\begingroup$

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.

my project: https://github.com/khaifagifari/Classification-and-Clustering-on-Used-Cars-Dataset

source : https://github.com/f2005636/Classification https://www.kaggle.com/vbmokin/used-cars-price-prediction-by-15-models

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

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

Source : https://stackoverflow.com/questions/2595176/which-machine-learning-classifier-to-choose-in-general/15881662

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

if you use just one feature for dataset, i'm recommend a Algorithm Naive Bayes Classifier because Naive Bayes is a method using probability and statistical methods. And we can also get the total data train and its accuracy value by using.

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

I think no matter you use one or more feature for dataset. You can compare the classification algorithms regarding the accuracy provided by the algorithm. Like compare naive bayes with svm method, it based on your problem set.

| 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.