function [X,y] = genRegression(N,d) % genRegression generates the artificial training data for linear regression. % % function [X,y] = genRegression(N,d) % % INPUT: % N (scalar) the number of data points % d (scalar) the dimension of the data points % % OUTPUT: % X (matrix) the artificial generated data points, size N by d+1 % y (vector) the target values, size N by 1 % By Wei Tang (wtang@cs.utexas.edu) y = linspace(1,10,N)'+0.15*randn(N,1); X = [ones(N,1),linspace(2,15,N)'*ones(1,d)+0.2*randn(N,d)]; end % genRegression function