Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Java for Data Science

You're reading from  Java for Data Science

Product type Book
Published in Jan 2017
Publisher Packt
ISBN-13 9781785280115
Pages 386 pages
Edition 1st Edition
Languages
Authors (2):
Richard M. Reese Richard M. Reese
Profile icon Richard M. Reese
Jennifer L. Reese Jennifer L. Reese
Profile icon Jennifer L. Reese
View More author details

Table of Contents (19) Chapters

Java for Data Science
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
Getting Started with Data Science Data Acquisition Data Cleaning Data Visualization Statistical Data Analysis Techniques Machine Learning Neural Networks Deep Learning Text Analysis Visual and Audio Analysis Mathematical and Parallel Techniques for Data Analysis Bringing It All Together

Implementing basic matrix operations


There are several different types of matrix operations, including simple addition, subtraction, scalar multiplication, and various forms of multiplication. To illustrate the matrix operations, we will focus on what is known as matrix product. This is a common approach that involves the multiplication of two matrixes to produce a third matrix.

Consider two matrices, A and B, where matrix A has n rows and m columns. Matrix B will have m rows and p columns. The product of A and B, written as AB, is an n row and p column matrix. The m entries of the rows of A are multiplied by the m entries of the columns of matrix B. This is more explicitly shown here, where:

Where the product is defined as follows:

We start with the declaration and initialization of the matrices. The variables n, m, p represent the dimensions of the matrices. The A matrix is n by m, the B matrix is m by p, and the C matrix representing the product is n by p:

int n = 4; 
int m = 2; 
...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}