Search by Algolia
Feature Spotlight: Query Rules
product

Feature Spotlight: Query Rules

You’re running an ecommerce site for an electronics retailer, and you’re seeing in your analytics that users keep ...

Jaden Baptista

Technical Writer

An introduction to transformer models in neural networks and machine learning
ai

An introduction to transformer models in neural networks and machine learning

What do OpenAI and DeepMind have in common? Give up? These innovative organizations both utilize technology known as transformer models ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What’s the secret of online merchandise management? Giving store merchandisers the right tools
e-commerce

What’s the secret of online merchandise management? Giving store merchandisers the right tools

As a successful in-store boutique manager in 1994, you might have had your merchandisers adorn your street-facing storefront ...

Catherine Dee

Search and Discovery writer

New features and capabilities in Algolia InstantSearch
engineering

New features and capabilities in Algolia InstantSearch

At Algolia, our business is more than search and discovery, it’s the continuous improvement of site search. If you ...

Haroen Viaene

JavaScript Library Developer

Feature Spotlight: Analytics
product

Feature Spotlight: Analytics

Analytics brings math and data into the otherwise very subjective world of ecommerce. It helps companies quantify how well their ...

Jaden Baptista

Technical Writer

What is clustering?
ai

What is clustering?

Amid all the momentous developments in the generative AI data space, are you a data scientist struggling to make sense ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is a vector database?
product

What is a vector database?

Fashion ideas for guest aunt informal summer wedding Funny movie to get my bored high-schoolers off their addictive gaming ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Unlock the power of image-based recommendation with Algolia’s LookingSimilar
engineering

Unlock the power of image-based recommendation with Algolia’s LookingSimilar

Imagine you're visiting an online art gallery and a specific painting catches your eye. You'd like to find ...

Raed Chammam

Senior Software Engineer

Empowering Change: Algolia's Global Giving Days Impact Report
algolia

Empowering Change: Algolia's Global Giving Days Impact Report

At Algolia, our commitment to making a positive impact extends far beyond the digital landscape. We believe in the power ...

Amy Ciba

Senior Manager, People Success

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve
e-commerce

Retail personalization: Give your ecommerce customers the tailored shopping experiences they expect and deserve

In today’s post-pandemic-yet-still-super-competitive retail landscape, gaining, keeping, and converting ecommerce customers is no easy ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Algolia x eTail | A busy few days in Boston
algolia

Algolia x eTail | A busy few days in Boston

There are few atmospheres as unique as that of a conference exhibit hall: the air always filled with an indescribable ...

Marissa Wharton

Marketing Content Manager

What are vectors and how do they apply to machine learning?
ai

What are vectors and how do they apply to machine learning?

To consider the question of what vectors are, it helps to be a mathematician, or at least someone who’s ...

Catherine Dee

Search and Discovery writer

Why imports are important in JS
engineering

Why imports are important in JS

My first foray into programming was writing Python on a Raspberry Pi to flicker some LED lights — it wasn’t ...

Jaden Baptista

Technical Writer

What is ecommerce? The complete guide
e-commerce

What is ecommerce? The complete guide

How well do you know the world of modern ecommerce?  With retail ecommerce sales having exceeded $5.7 trillion worldwide ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

Data is king: The role of data capture and integrity in embracing AI
ai

Data is king: The role of data capture and integrity in embracing AI

In a world of artificial intelligence (AI), data serves as the foundation for machine learning (ML) models to identify trends ...

Alexandra Anghel

Director of AI Engineering

What are data privacy and data security? Why are they  critical for an organization?
product

What are data privacy and data security? Why are they critical for an organization?

Imagine you’re a leading healthcare provider that performs extensive data collection as part of your patient management. You’re ...

Catherine Dee

Search and Discovery writer

Achieving digital excellence: Algolia's insights from the GDS Retail Digital Summit
e-commerce

Achieving digital excellence: Algolia's insights from the GDS Retail Digital Summit

In an era where customer experience reigns supreme, achieving digital excellence is a worthy goal for retail leaders. But what ...

Marissa Wharton

Marketing Content Manager

AI at scale: Managing ML models over time & across use cases
ai

AI at scale: Managing ML models over time & across use cases

Just a few years ago it would have required considerable resources to build a new AI service from scratch. Of ...

Benoit Perrot

VP, Engineering

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

To consider the question of what vectors are, it helps to be a mathematician, or at least someone who’s comfortable thinking in a mathematical way.

If that’s not you, which it probably isn’t if you’re an ecommerce marketing manager or exec, no worries. The Web is chock full of detailed, colorfully illustrated information about vectors.

For a starting point, the Math Is Fun site, written to help elementary-through-high-school kids but welcoming to non-techies of all ages (and, there’ll be no quizzes), does a great job of summing up the concept

So, quick disclaimer…this blog post isn’t about to exhaustively present everything (or in some cases, anything) about vectors and vector analysis and vector graphics. No. We’re not going into the weeds on vectors. This is a post meant to highlight vector-enhanced search technology, after all. Rest assured, you know how to Google if you need details.

Meanwhile, here’s our best shot at the topic. 

How is a vector visualized?

Standard numbers are the components of a vector. The components show influence in a given direction of the vector.

Mathematicians refer to the visualization of vectors by talking about components in a coordinate system. In a two-dimensional plane, a vector logically has two components, while in a three-dimensional one, it has (you guessed it) three.

Geometrically, a vector often encompasses coordinates in an n-dimensional space (n refers to the quantity of dimensions, for instance, two). It signifies the position of a coordinate in an n-dimensional space.

In the Cartesian coordinate system, vector quantities are represented in a space with an x axis — a horizontal straight line — and a y axis — a vertical straight line that’s perpendicular to the x axis.

A given vector looks pretty simple, like a straight line capped by an arrowhead. The direction of a vector in rudimentary illustrations shows the length of the line “optimistically” slanting up at an angle, from left to right.

Vectors are typically designated in boldface (e.g., vector a and vector b).

The magnitude of a vector is indicated by a vertical bar on each side of the vector, like this: |a|.

Types of vectors

There are various types of vectors, including: 

  • A unit vector, which has a magnitude of 1
  • A zero vector (null), which has a magnitude of zero and points in no direction
  • A position vector, which denotes the location of a point with respect to an arbitrary reference point
  • The sum of two or more vectors, a resultant vector
  • An equal vector, two or more vectors with the same magnitude and direction
  • A column vector, which is when vector components are displayed vertically

The definition of a vector

So that’s a (somewhat rambling) math-based explanation of a vector.

Now let’s go in the opposite direction for a broader picture — what does Merriam-Webster use as its plain-English assessment of vectors?

The dictionary’s official definition is “a quantity that has magnitude and direction and that is usually represented by a line segment with the given direction and with a length representing the magnitude.”

Fun facts

Here are a few more data points about vectors:

  • A vector is an element of a vector space (also known as a linear space), a geometric object collection with an addition rule and a scalar multiplication rule
  • It’s an object that looks like a directed line segment (though not all vectors are directed line segments)
  • When its operations can be interpreted appropriately, it’s considered a vector
  • Physical quantities that vectors can represent include acceleration, displacement, and velocity

The role of scalars

Another way of describing a vector like it’s a scientific thing is this: A tuple that has scalars (numbers or values from a dataset). 

According to Britannica, examples of scalars include density, energy, volume, time, and mass.

The thing to know about scalars is that they don’t possess magnitude; they just “scale” vectors up and down.

A quantity that doesn’t rely on direction is a scalar quantity, according to NASA.

Dot products and cross products

How do vector operations work, besides the fact that in vector math, you can use real numbers and get the results of applying vector addition, vector subtraction, and multiplication of vectors?

  • Using a vector dot product (also known as a scalar product or inner product) — a tool for determining vector decompositions, projections, and orthogonality — you can figure out the sum of the multiplied elements of two same-length vectors to determine a scalar.
  • The vector cross product (also known as the vector product) is used to multiply two vectors. The result of cross-product a x b (read as a cross b) is a new vector running perpendicular to the a and b ones.

How are vectors used in machine learning?

For programming, vectors are an effective way to organize and store objects and object collections in containers for use in machine-learning applications. They’re used for various scenarios, such as when supervised and unsupervised learning algorithms are applied to create recommendations.

One of the most-cited examples of vectors in machine learning is support vector machines (SVMs). In this scenario, a supervised algorithm solves problems by applying classification.

Vectorizing data

Before feeding data into a machine-learning model, it is “vectorized” — converted into numbers representing a point or point sequence in the vector space.

The vectors in machine learning signify input data, including bias and weight. In the same way, output from a machine-learning model (for example, a predicted class), can be put into vector format.

A lowercase v is used to designate a vector. The magnitude of the vector (its length), as well as its origin and direction, are labeled. When training a machine-learning algorithm, the target variable may be represented by a lowercase y.

Machine learning and vector search

Now let’s look at the role of vectors in something concrete that you may be interested in: vector search.

Modern applications of vector functionality are a help for letting website users do broad-based searches and get accurate recommendations, personalization, answers to their FAQs, and more.

With semantic search, data to provide in search results can be identified using approximate nearest neighbor (ANN) algorithms.

In a machine-learning context, vector search is able to look at unstructured data — such as what’s in text, photos, or audio — and translate its context and meaning into numeric representation. This vectorization — converting words into numbers — lets the information be used for automating synonyms, clustering documents‍, detecting meaning and intent in search queries, and ranking search results.

Embeddings are n-dimensional vectors created by deep-learning algorithms to assign semantic definition to input. Other objects, like documents, images, video, and audio, can also be embedded. Machine-learning tasks have improved substantially thanks to embedding. 

The role of neural hashing

One of the challenges in working with vectors in machine learning is their size: they tend to be very long and require specialized databases and GPU management. To address this problem, neural hashing can use neural networks to compress them. The result: processing can be up to 500 times faster than when using standard vector calculations, and these hashed vectors can be run on commodity hardware.

Vector search: half a solution

Vector search is an effective new technology that works well for broad-based searches. Traditional keyword search, however, still provides the best results for searches that involve someone’s specific intentions.

For example, when someone enters “Levi’s” in a traditional keyword search-engine box, they’d see search results for only that brand — a relatively narrow information window. By contrast, a shopper’s broad-based vector search would return a wider array of similar results, like perhaps other brands that have a similar look and items in the same conceptual category.

If you want to offer your users the best search capabilities, how do you get around this challenge? You put the two together, of course.

That’s exactly what Algolia does. For the most relevant, fastest searching, we use a hybrid approach of both vector and keyword search, ensuring that your users get the best results for both exact-match queries and broad, long-tail queries. Our innovative NeuralSearch technology also scales to meet the needs of any size dataset.  

Scale up your search

That’s it for our discussion of vectors and how their presence is transforming the search industry. Want to put vectors to work on your business’s behalf? Contact us to learn how Algolia can help get you pointed in the right direction, toward higher ROI, with smart search.

About the author
Catherine Dee

Search and Discovery writer

linkedin

Recommended Articles

Powered byAlgolia Algolia Recommend

What is a vector database?
product

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is vector search?
ai

Dustin Coates

Product and GTM Manager

The past, present, and future of semantic search
ai

Julien Lemoine

Co-founder & former CTO at Algolia