Linear Regression Coding Help

Anyone have any examples related to linear regression or exponential drive to modify motor speed?