DEV Community

Cover image for What is Machine Learning ?
Inder from lightspeedev
Inder from lightspeedev

Posted on

What is Machine Learning ?

Imagine an Excel sheet with 10,000 rows and 10 columns, representing data like stock prices, house prices, medical records, or anything else. As a human, analysing such a massive dataset to uncover meaningful patterns or make predictions would be incredibly challenging.

This is where machine learning comes to the rescue. It enables computers to process vast amounts of data, uncover patterns, make predictions—such as forecasting stock or house prices—or even evaluate the accuracy of medical procedures, all with remarkable efficiency.

Machine learning is the subset of artificial intelligence, which enables computers to learn from the data without being explicitly programmed.

Building Blocks of a Machine Learning Model

Data

Data is the foundation on which your machine learning model is built. The quality and quantity of data directly influence the model's performance. The phrase "Garbage in, Garbage out" holds true—if the data is flawed or irrelevant, the model's predictions will be unreliable. Ensuring clean, accurate, and representative data is critical.

Features

Features are the measurable characteristics or attributes extracted from your data that the model uses for learning.

Example: For stock prices with OHLC (Open, High, Low, Close) data, features like moving averages or RSI (Relative Strength Index) can be created.
For other domains:

  • Medical data: Features could include age, blood pressure, or cholesterol levels.

  • Real estate: Features might include house size, location, and number of rooms.

  • Effective feature engineering helps the model uncover patterns more easily.

Algorithm

An algorithm is the set of instructions the model follows to interpret the data and learn from it. It defines the way the model processes inputs to produce outputs.

Examples of algorithms:

  • Decision Trees
  • Linear Regression
  • Naive Bayes
  • The choice of algorithm depends on the type of problem (classification, regression, clustering, etc.) and the data structure.

Training and Testing Data

The data is typically split into two parts:

  • Training Data: Used to train the model, allowing it to learn patterns and relationships within the data.
  • Testing Data: Used to evaluate how well the model performs on unseen data, ensuring it generalizes effectively.
  • A common split is 80:20 or 70:30, but this can vary based on the dataset size and problem requirements.

Model

The model is the output of the machine learning process—a representation of the patterns and relationships learned from the data. It is used to make predictions or decisions.

  • After creating the model, additional steps like hyperparameter tuning, cross-validation, or benchmarking can further enhance its performance and reliability.

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 👀

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay