add functionality for training linear regression model