Supervised Learning
In the vast realm of machine learning, one term you may come across is "supervised learning." But what exactly does it entail?Machine learning can be categorized into three main types of learning:
- supervised learning
- unsupervised learning
- reinforcement learning.
For now, let's delve into the concept of supervised learning.
Supervised learning is a technique where computers comprehend patterns in data with specific labels. To illustrate, consider the following dataset:In the dataset above, you can observe a column named "label" that represents categorical types (sick, normal, dizzy). This column classifies individuals into specific health conditions. Those who possess such data follow the path of supervised learning. As humans, we provide data along with meticulously curated labels, enabling computers to learn patterns from the provided information.
Consequently, when new data is introduced, we can predict the label with a high probability based on the acquired knowledge.
Python offers various tools and libraries for implementing supervised learning, as demonstrated in the following example:
The code above imports some of the libraries needed to perform the SGDClassifier (Stochastic Gradient Descent Classifier) using the iris dataset provided by sklearn.
separate data for training and for testing, for training by 80% and for testing by 20% of the full dataset
perform data training from previous data using the SGDClassifier built method, this is a function from sklearn.
Performing a prediction test by entering X_test data
the result obtained is 60% prediction accuracy, this is a good number but we can increase it again with additional parameters.
By employing appropriate libraries, we can download datasets and explore the possibilities of supervised learning. This invaluable approach empowers us to make informed predictions and decisions based on patterns and labeled data.
Ctrl+Alt+Goodbye: Logging off with tech-tastic memories and geeky adventures. Stay wired for more tech tales in the digital universe! ✌