1
$\begingroup$

So, I'm currently a third year student in electrical engineering and I'm currently enrolled in a Mathematical Modelling and Machine Learning class and we're currently tasked to classify or use regression for the given datasets. Members of my group are all confused on how to tackle this problem since we're practically equipped with little to no knowledge and are told to explore the ocean by ourselves.

Here's the dataset that my group are tasked with: https://univindonesia-my.sharepoint.com/:x:/g/personal/andrano_mario_office_ui_ac_id/ETCLu_dRRWtCjgg1hDmnTGEB78T2DbIMRGvFQm6bzjpP-Q?e=8Cu9Bo

From my understanding, this dataset is a form of multi-class classification problem since I thought that the output of this dataset is "quality" which can range anywhere from 1 to 10 (What I saw in the dataset is that the quality of those wines are mostly 4, 5, 6, 7, or 8 so I assume that it's from 1 to 10).

Now if this dataset does refer to a multi-classification problem, where should I start. My lecturer gave me his PowerPoints about SVMs but those are barely readable to me, it's filled with equations and no real life examples on how to do anything with those equations. Can anyone give me a clue on how should I tackle this problem, and also can anyone give me some good resources? I've been given books about the mathematics of it but none of them actually give understandable examples. (I learn better if I know how those mathematical equations are used in-depth).

$\endgroup$
1
  • $\begingroup$ What are your arguments in favor of and against this being a classification problem? What are your arguments in favor of and against this being a regression problem? (The ideal approach is probably a hybrid of the two called ordinal regression, but let’s start with some basics.) $\endgroup$
    – Dave
    Sep 24, 2023 at 13:55

1 Answer 1

1
$\begingroup$

I understand your situation, and I'm here to help you get started with tackling this multi-class classification problem using machine learning. Let's break down the steps and provide you with some practical guidance and resources:

1. Data Exploration:

  • Begin by loading and exploring the dataset to understand its structure and features. You can use Python libraries like Pandas and Matplotlib for this purpose.
import pandas as pd
import matplotlib.pyplot as plt

# Load the dataset
data = pd.read_csv("winequality-red.csv")

# Explore the first few rows of the dataset
print(data.head())

# Check for missing values
print(data.isnull().sum())

# Visualize the distribution of the "quality" column
plt.hist(data['quality'], bins=range(1, 11))
plt.xlabel('Quality')
plt.ylabel('Count')
plt.show()

2. Data Preprocessing:

  • Handle missing values, if any, and convert the "quality" column into a categorical variable for multi-class classification.
# Convert quality to a categorical variable
data['quality'] = pd.Categorical(data['quality'])

# Split the data into features (X) and target (y)
X = data.drop('quality', axis=1)
y = data['quality']

# Split the data into training and testing sets
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

3. Choose a Classifier:

  • Since you mentioned SVMs, you can start by using Support Vector Machines for multi-class classification. However, you can also explore other classifiers like Random Forest, Logistic Regression, or Neural Networks.
from sklearn.svm import SVC
model = SVC()

4. Model Training:

  • Train your chosen model on the training data.
model.fit(X_train, y_train)

5. Model Evaluation:

  • Evaluate the model's performance on the test data using appropriate metrics like accuracy, precision, recall, and F1-score for multi-class classification.
from sklearn.metrics import classification_report, accuracy_score

y_pred = model.predict(X_test)
print("Accuracy:", accuracy_score(y_test, y_pred))
print(classification_report(y_test, y_pred))

6. Resources for Learning:

  • If your lecturer's materials are difficult to understand, you can explore other resources to learn about SVMs and machine learning in general:

    a. Online Courses:

    • Coursera and edX offer courses on machine learning and data science. For example, "Machine Learning" by Andrew Ng on Coursera is highly recommended.

    b. Books:

    • "Introduction to Machine Learning with Python" by Andreas C. Müller & Sarah Guido is a great resource with practical examples using Python.

    c. Online Tutorials and Blogs:

    • Websites like Towards Data Science, Medium, and DataCamp have articles and tutorials on various machine learning topics with practical examples.

    d. YouTube Channels:

    • Channels like "StatQuest with Josh Starmer" provide intuitive explanations of complex machine learning concepts.

Remember, practice and hands-on experience are crucial for understanding and mastering machine learning. Start with simple models and gradually move to more complex ones as you gain confidence. Good luck with your project, and feel free to ask if you have more specific questions or need further guidance on any step!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.