Teaching with Technology in MATH547
Linear Algebra for Applications in Data Science

Background and motivation

Imparting data literacy is a topic of timely interest for UNC. A key foundation for data science is linear algebra, the study of scaling and combining multidimensional objects. These objects can be images, medical records, sounds, social networks. They all tend to be represented by groupings of numbers (vectors, 𝒙,𝒃), and combining them to form new objects is encoded in yet other groupings of numbers (matrices 𝑨,𝑩). Traditional teaching of the associated mathematical concepts typically use hand exercises for small vectors, i.e.,

𝑨=( 1 2 -1 3 ),𝒙=( 1 -1 ),𝒃=𝑨𝒙=( 1 2 -1 3 )( 1 -1 )=( -1 -4 ).

Though correct, such presentations do not explore the rich variety of applications of linear algebra to the large-scale applications driving the current interest in data science.

Teaching technology to be introduced

This course builds upon previous experience to provide live course material that combines theoretical concepts with embedded computation and visualization. The new technologies to be used are:

Instructional benefits

Example:

In this example, the MIT data base of face images is processed to produce various representations of an “average individual”. All operations are modifiable directly from within the document allowing student exploration of the topic of facial recognition.

octave: 
function cimg=cmprim(img,p)
  [h,w]=size(img); mat=zeros(h,w); mat=double(img)/255.;
  [U S V]=svd(img); s=diag(S); cmat=zeros(h,w);
  for i=1:p
    cmat = cmat + s(i)*U(:,i)*V(:,i)';
  end;
  cmn=min(min(cmat)); cmat=cmat+cmn*ones(h,w);
  cmx=max(max(cmat)); sc=255./cmx; cmat=sc*cmat; cimg=uint8(cmat);
  fname=strcat("/home/student/courses/MATH547ML/cimg",num2str(p),".png");
  imwrite(cimg,fname);
endfunction;
octave: 
load /home/student/courses/MATH547/lessons/mitfaces/faces.mat;
octave: 
face=reshape(a,128,128)';
facep01=cmprim(face,1); facep02=cmprim(face,2); facep04=cmprim(face,4);
facep08=cmprim(face,8); facep16=cmprim(face,16); facep32=cmprim(face,32);
facep64=cmprim(face,64); facep128=cmprim(face,128);
octave: 

p=1 p=2 p=4 p=8 p=16 p=32