What is machine learning, and how is it different from regular programming?
In regular programming you write the rules and the program turns input into output. In machine learning the direction flips: you give the algorithm inputs and correct answers, and it finds the rules itself, encoded as model parameters. A spam filter is a good example: writing thousands of rules for every trick is nearly impossible, but given thousands of labelled emails a model learns the signals on its own.
Machine learning is a subset of AI, and deep learning is a subset of machine learning that uses multi-layer neural networks. Today's large language models belong to that family; if you are interested in applying them, see building a chatbot with LLMs.
The three main families of learning
| Type | Data | Goal | Example |
|---|---|---|---|
| Supervised | Inputs + labels | Predict a label or a number | Spam detection, house price prediction |
| Unsupervised | Inputs only | Find hidden structure | Customer segmentation |
| Reinforcement | Rewards from an environment | Learn a policy of actions | Robots, games |
In ordinary businesses most applications are supervised. Its two main kinds are classification (the output is a category) and regression (the output is a number).
The steps of building a model
- Define the problem: what exactly are we predicting, and which decision does that prediction change?
- Collect and clean data: missing values, duplicates and outliers. The main tool here is Python and pandas.
- Feature engineering: building useful columns, such as time since the last purchase.
- Split the data: one part for training and one for testing.
- Train and evaluate: build a simple model and measure it with an appropriate metric.
- Deploy and monitor: in production models gradually go stale and must be monitored.
If you have a data-driven project, our data analysis service can handle the preparation and exploratory stages.

Your first model with scikit-learn
The example below loads the breast cancer dataset bundled with scikit-learn (install with pip install scikit-learn), splits the data, trains a random forest and prints a report. The dataset is for learning only and must not be used for medical decisions.
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
X, y = load_breast_cancer(return_X_y=True)
# keep class proportions equal in both splits
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, stratify=y, random_state=42)
model = RandomForestClassifier(n_estimators=200, random_state=42)
model.fit(X_train, y_train)
print(classification_report(y_test, model.predict(X_test)))A few notes: random_state makes the result reproducible, stratify preserves class proportions and the report is computed on data the model has never seen. For more, the scikit-learn documentation is a solid reference.
Evaluation: accuracy alone is not enough
Suppose only 2 percent of transactions are fraudulent. A model that always says "legitimate" scores 98 percent accuracy and is completely useless. That is why we use other metrics as well:
- Precision: of the cases the model called positive, how many really were?
- Recall: of the real positives, how many did it find?
- F1: the harmonic mean of both, for when both matter.
- MAE / RMSE: for regression, the typical numeric error.
Choosing the metric is a business decision: in disease screening, missing a real case (low recall) is worse than an extra alarm; in a spam filter it is the opposite, since deleting an important email costs more.
Common beginner mistakes
- Data leakage: a column that reveals the future, or normalising on the whole dataset before splitting, makes results look misleadingly good.
- Overfitting: the model memorises the training data and performs poorly on new data. A large gap between training and test scores is the sign.
- Reaching for a complex model: try logistic regression or a simple tree first; it is often enough and easier to explain.
- Ignoring imbalanced data: with rare classes, do not rely on accuracy alone.
- No monitoring after deployment: user behaviour changes and the model slowly degrades.
Next steps for learning and business use
A suggested path: Python and pandas for working with data, then scikit-learn for classic models, and deep learning only if you need it. Small real projects, such as predicting customer churn with your own data, teach more than any theory course.
For businesses, ask before building a model whether a simple rule or a good report would solve the problem. If not, business automation with AI and our AI service are a good starting point, and for the software angle read AI in software development.
Frequently asked questions
What is the difference between AI, machine learning and deep learning?
AI is the broad idea of intelligent machines. Machine learning is the subset that learns from data, and deep learning is a subset of that which uses multi-layer neural networks.
What maths do I need to start machine learning?
Basic statistics, an introduction to linear algebra and a little calculus are enough to begin. You can try many ideas with libraries like scikit-learn first and deepen the maths alongside projects.
How much data do I need to build a model?
There is no fixed number. Simple problems often work with a few hundred to a few thousand clean samples, while deep learning usually needs much more. Quality and representativeness matter more than raw size.
Do I have to know Python for machine learning?
Not strictly, but Python is the most common choice thanks to libraries like pandas, scikit-learn and PyTorch, and most tutorials and tools target it, so starting there is easier.

Comments
No comments yet. Be the first to share your thoughts.