ai with python supervised learningregression regression is one of the most important statistical and machine learning tools we would not be wrong to say that the journey of machine learning starts from regression it may be defined as the parametric technique that allows us to make decisions based upon data or in other words allows us to make predictions based upon data by learning the relationship between input and output variables herethe output variables dependent on the input variablesare continuous-valued real numbers in regressionthe relationship between input and output variables matters and it helps us in understanding how the value of the output variable changes with the change of input variable regression is frequently used for prediction of priceseconomicsvariationsand so on building regressors in python in this sectionwe will learn how to build single as well as multivariable regressor linear regressor/single variable regressor let us important few required packagesimport numpy as np from sklearn import linear_model import sklearn metrics as sm import matplotlib pyplot as plt nowwe need to provide the input data and we have saved our data in the file named linear txt input ' :/programdata/linear txtwe need to load this data by using the np loadtxt function input_data np loadtxt(inputdelimiter=','xy input_data[::- ]input_data[:- the next step would be to train the model let us give training and testing samples training_samples int( len( )testing_samples len(xnum_training x_trainy_train [:training_samples] [:training_samplesx_testy_test [training_samples:] [training_samples: