Skip to main content
their -> they're
Source Link
David Marx
  • 7.1k
  • 2
  • 30
  • 46

As you can see, the points are displaced significantly relative to their initial positions in the XY plane, but much less so from their positions in the XZ and YZ planes. Moreover, the transformations in the XZ and YZ planes look very similar. In fact, the starting positions in the XZ and YZ planes look very similar. This isn't surprising: in this example, X and Y are so tightly correlated, theirthey're practically interchangeable. PCA is a technique that let's us say (in this example), "Hey, these variables are so close, we don't really need both. Let's pretend our data is two dimensional instead of three dimensional, because it may as well be."

As you can see, the points are displaced significantly relative to their initial positions in the XY plane, but much less so from their positions in the XZ and YZ planes. Moreover, the transformations in the XZ and YZ planes look very similar. In fact, the starting positions in the XZ and YZ planes look very similar. This isn't surprising: in this example, X and Y are so tightly correlated, their practically interchangeable. PCA is a technique that let's us say (in this example), "Hey, these variables are so close, we don't really need both. Let's pretend our data is two dimensional instead of three dimensional, because it may as well be."

As you can see, the points are displaced significantly relative to their initial positions in the XY plane, but much less so from their positions in the XZ and YZ planes. Moreover, the transformations in the XZ and YZ planes look very similar. In fact, the starting positions in the XZ and YZ planes look very similar. This isn't surprising: in this example, X and Y are so tightly correlated, they're practically interchangeable. PCA is a technique that let's us say (in this example), "Hey, these variables are so close, we don't really need both. Let's pretend our data is two dimensional instead of three dimensional, because it may as well be."

fixed typos
Source Link
Scortchi
  • 31.6k
  • 9
  • 102
  • 281

Your initial data was roatatedrotated in the existing three dimensions such that the bulk of the variance was along the X axis, then rotated again such that the remaining variance was predominantly along the Y axis. Then the Z axis was flattened so only the new X and Y axes remained.

It makes sense that the resulting plot looks random: it is random. The principleprincipal components capture the variance in the data. The idea is that if two variables are tightly correlated, we probably aren't adding much information by including both in our model: we really only need one, especially if one variable is actually a function of the other. Principle Principal components is an easy way to ignore those relationships.

Your initial data was roatated in the existing three dimensions such that the bulk of the variance was along the X axis, then rotated again such that the remaining variance was predominantly along the Y axis. Then the Z axis was flattened so only the new X and Y axes remained.

It makes sense that the resulting plot looks random: it is random. The principle components capture the variance in the data. The idea is that if two variables are tightly correlated, we probably aren't adding much information by including both in our model: we really only need one, especially if one variable is actually a function of the other. Principle components is an easy way to ignore those relationships.

Your initial data was rotated in the existing three dimensions such that the bulk of the variance was along the X axis, then rotated again such that the remaining variance was predominantly along the Y axis. Then the Z axis was flattened so only the new X and Y axes remained.

It makes sense that the resulting plot looks random: it is random. The principal components capture the variance in the data. The idea is that if two variables are tightly correlated, we probably aren't adding much information by including both in our model: we really only need one, especially if one variable is actually a function of the other. Principal components is an easy way to ignore those relationships.

deleted 3 characters in body
Source Link
David Marx
  • 7.1k
  • 2
  • 30
  • 46
# The end point of each line signifies the end point of the PCA transformation.
PCA_transform_plot=function(dims){
  plot(df[,dims], main=t(pastemain=paste(names(df)[dims], collapse="")))
  sapply(1:nrow(df), function(i){
    lines(rbind(df[i,dims]
               ,pc.sd1$scores[i,1:2] 
                )
          ,col='red'     
          )      
  })
}

par(mfrow=c(1,3))
PCA_transform_plot(c(1,2))
PCA_transform_plot(c(1,3))
PCA_transform_plot(c(2,3))
# The end point of each line signifies the end point of the PCA transformation.
PCA_transform_plot=function(dims){
  plot(df[,dims], main=t(paste(names(df)[dims], collapse="")))
  sapply(1:nrow(df), function(i){
    lines(rbind(df[i,dims]
               ,pc.sd1$scores[i,1:2] 
                )
          ,col='red'     
          )      
  })
}

par(mfrow=c(1,3))
PCA_transform_plot(c(1,2))
PCA_transform_plot(c(1,3))
PCA_transform_plot(c(2,3))
# The end point of each line signifies the end point of the PCA transformation.
PCA_transform_plot=function(dims){
  plot(df[,dims], main=paste(names(df)[dims], collapse=""))
  sapply(1:nrow(df), function(i){
    lines(rbind(df[i,dims]
               ,pc.sd1$scores[i,1:2] 
                )
          ,col='red'     
          )      
  })
}

par(mfrow=c(1,3))
PCA_transform_plot(c(1,2))
PCA_transform_plot(c(1,3))
PCA_transform_plot(c(2,3))
added 645 characters in body
Source Link
David Marx
  • 7.1k
  • 2
  • 30
  • 46
Loading
added 645 characters in body
Source Link
David Marx
  • 7.1k
  • 2
  • 30
  • 46
Loading
added 1369 characters in body
Source Link
David Marx
  • 7.1k
  • 2
  • 30
  • 46
Loading
Source Link
David Marx
  • 7.1k
  • 2
  • 30
  • 46
Loading