How to calculate dot product of two vectors?

How to calculate dot product of two vectors?

How to calculate dot product of two vectors?

This recipe helps you calculate dot product of two vectors


Recipe Objective

Do you find calculating dot product is easy? Have to tried to find it using python.

So this is the recipe on how we can calculate dot product of two vectors.

Step 1 - Importing Library

import numpy as np

We have only imported numpy which is needed.

Step 2 - Creating Vector

We have created two array of which we will find vector product. vectorA = np.array([1,2,3]) vectorB = np.array([4,5,6])

Step 3 - Finding dot product

We will find dot product by two methods. One by using function and passing the vectors in it and also by using @ which is used to finding dot product. print(, vectorB)) print(vectorA @ vectorB) So the output comes as



Relevant Projects

Predict Macro Economic Trends using Kaggle Financial Dataset
In this machine learning project, you will uncover the predictive value in an uncertain world by using various artificial intelligence, machine learning, advanced regression and feature transformation techniques.

Zillow’s Home Value Prediction (Zestimate)
Data Science Project in R -Build a machine learning algorithm to predict the future sale prices of homes.

Predict Census Income using Deep Learning Models
In this project, we are going to work on Deep Learning using H2O to predict Census income.

Data Science Project on Wine Quality Prediction in R
In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

Identifying Product Bundles from Sales Data Using R Language
In this data science project in R, we are going to talk about subjective segmentation which is a clustering technique to find out product bundles in sales data.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Human Activity Recognition Using Multiclass Classification in Python
In this human activity recognition project, we use multiclass classification machine learning techniques to analyse fitness dataset from a smartphone tracker.

Data Science Project in Python on BigMart Sales Prediction
The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

Forecast Inventory demand using historical sales data in R
In this machine learning project, you will develop a machine learning model to accurately forecast inventory demand based on historical sales data.

German Credit Dataset Analysis to Classify Loan Applications
In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.