What is Machine Learning?
Machine learning (ML) is a branch of artificial intelligence where a program learns to perform a task by finding patterns in data, instead of being given a fixed rule for every situation. You show the system many examples, it adjusts its internal settings to match them, and then it can make predictions on new, unseen data.
Learning from examples, not rules
Suppose you want to tell apart photos of cats and dogs. Writing rules by hand — "if it has pointy ears and whiskers..." — quickly falls apart, because real photos vary endlessly. Machine learning flips the approach: you collect many labelled photos, and the algorithm works out for itself which patterns separate the two. The output is a model: a set of learned numbers that maps an input to a prediction.
The key shift is that the programmer supplies the data and the learning method, while the algorithm supplies the rules. This is why ML is so useful for tasks that are easy for people but hard to describe in code, like recognising speech or spotting fraud.
The three main types of machine learning
- Supervised learning: the data is labelled with the correct answer. The model learns to predict that label for new inputs — for example, predicting house price from size and location. See supervised vs unsupervised learning.
- Unsupervised learning: the data has no labels. The model finds structure on its own, such as grouping customers into segments.
- Reinforcement learning: an agent learns by trial and error, receiving rewards or penalties for its actions, as in game-playing or robot control.
Supervised learning is the most common starting point because the goal is clear and the results are easy to check.
A tiny example in Python
Here is a complete supervised-learning example using scikit-learn, the standard ML library for Python. It learns the relationship between hours studied and exam score.
# Predict an exam score from hours studied (simple linear regression).
import numpy as np
from sklearn.linear_model import LinearRegression
# Training data: hours studied (input) and score (label).
# scikit-learn expects inputs as a 2-D array: one row per example.
X = np.array([[1], [2], [3], [4], [5]]) # hours
y = np.array([35, 50, 60, 72, 85]) # scores
model = LinearRegression() # choose the algorithm
model.fit(X, y) # learn from the data
Want to learn this properly?
Join the waitlist for our courses — beginner-friendly, project-first classes in Jalgaon.
Browse coursesPredict the score for a student who studies 6 hours.
prediction = model.predict([[6]]) print(round(prediction[0], 1)) # e.g. about 96.5
The model never saw 6 hours during training; it learned a trend from the examples and applied it to a new input. That generalisation to unseen data is the heart of machine learning. To build a fuller version, see [build your first ML model](/learn/ai-ml/first-ml-model).
## How a model is trained and tested
Training adjusts the model to fit the examples. But fitting the training data is not the goal — performing well on **new** data is. So we always hold back part of the data as a test set the model never sees during training, then measure how well it predicts on that. A model that scores well on training data but poorly on the test set is **overfitting**: it memorised noise instead of learning the real pattern.
## Common mistakes
- **Judging a model on its training data.** Always test on data the model has not seen, or the score is meaningless.
- **Too little or poor-quality data.** ML learns from what you give it. Biased, dirty, or tiny datasets produce unreliable models. Good [data preprocessing](/learn/ai-ml/data-preprocessing) matters as much as the algorithm.
- **Reaching for complex models too soon.** A simple model is easier to understand and often performs comparably on small problems. Start simple, then add complexity only if it helps.
- **Confusing correlation with cause.** A model finding that two things move together does not mean one causes the other.
## FAQ
**Is machine learning the same as AI?**
No. Machine learning is one branch of artificial intelligence. See [AI vs ML vs deep learning](/learn/ai-ml/ai-vs-ml-vs-dl).
**What language should I learn for ML?**
Python is the most common, thanks to libraries like scikit-learn, NumPy, and Pandas. Start with [Python for AI](/learn/ai-ml/python-for-ai).
**How much maths do I need?**
To begin, basic algebra and a little statistics are enough. Deeper work uses linear algebra, calculus, and probability, which you can build up gradually.
## Keep learning
Explore the full [AI & machine learning hub](/learn/ai-ml) for more guides, or join the waitlist for our structured [Artificial Intelligence course](/courses/artificial-intelligence) at Infoplanet, Jalgaon, to learn machine learning step by step with mentor support.
Want to learn this properly?
Join the waitlist for our courses — beginner-friendly, project-first classes in Jalgaon.
Browse coursesFounder, Atlee Technologies
Yash Kabra is the founder of Atlee Technologies, a product studio that ships SaaS products end-to-end. He owns products from strategy through launch and growth — including Infoplanet, TrackRise and Perqee — and teaches AI, Machine Learning and Data Science at Infoplanet with a focus on how these tools are used to build real products.
Related guides
AI Career Roadmap
A practical path into AI: build programming and maths foundations, learn the core machine learning workflow, then deepen into a specialism and prove it with projects.
AI vs ML vs Deep Learning
AI is the broad goal of intelligent machines; machine learning is one way to reach it by learning from data; deep learning is a powerful subset of machine learning using neural networks.
Classification vs Regression
Classification predicts a category; regression predicts a number. Both are supervised learning — the type of answer you want decides which one you use.
