The first column "TV" shows the amount of money in thousands of dollars spent on TV ads to advertise a single product. For example, in observation 200 (row number), $232,100 was spent on TV ads. Similarly, $8600 was spent on radio ads in the same observation. The "Sales" column represent the sales of the product being advertised in that observation in thousands of items. So, in observation 200, a quantity of 13,400 was sold. In this case, linear regression model can be useful to predict the sales based on amount of dollars spent on advertisement on different channel. The model uses "TV", "Radio" and "Newspaper" as the features and it predicts the sales as response. The model learns the linear relationship between the features and response in order to make the predictions. However, this model does not predict the advertisement expenses required to be put in different channels in order to reach a specific sales target. The Inverse Linear Regression algorithm can fulfil such requirements by leveraging the relationship learnt by the linear regression model. The outcome of the model also suggests the relative weight of each feature and how well each feature contributes in order to reach the target response. # II. Proposed Algorithm a) Deriving Relationship The relationship between features and response is learnt with the help of linear regression model. The linear regression model derives the weights of each feature (I.e. "TV", "Radio" and "newspaper") to calculate the response (I.e. "sales"). The formula representation of the relationship is given below: y (sales) = w 0 + w 1 .x 1 (TV ads) + w 2 .x 2 (Radio ads) + w 3 .x 3 (Newspaper ads) Once the linear regression model is trained with the features and response data, the model returns the intercept (w 0 ) and the coefficients (w 1 , w 2 and w 3 ). # b) Locating Nearest Features The proposed solution locates the nearest observation that has the response value less than the queried response for which the feature values are to be predicted. For each queried response, the immediate lower 'value in response' (r) that was used while training the linear regression model is located. Using the index of the located training response(r), the corresponding feature values are obtained from the observations. 17 Calculating 2 nd set of features: The algorithm repeats the steps described above to calculates x 2 (radio ads) for x 1 and x 2 from nearest observation and y = queried sales value. The 2 nd set of predicted feature values [x 1 , Predicted_x 2 , x 3 ]. Calculating 3 rd set of features: The same steps are repeated to predict x 3 . The 3 rd set of predicted feature values [x 1 , x 2 , Predicted_x 3 ]. # d) Output The solution returns a two dimensional array. Columns of the array represent features. Each row of the array is a set of predicted feature values. The no. of columns in array= the no. of rows in array= the no. of features in the observation. # III. # Conclusion The prediction accuracy by the proposed algorithm is as good as the accuracy of the linear regression model as the relationship determined by the linear regression model is leveraged by the new solution. Different sets of feature values provide the information about the effectiveness of each feature i.e. if the coefficient of a feature is relatively small, a larger amount is to be spent on that channel in order to get the target response. Thus, it provides the flexibility to the stakeholders to choose the appropriate mechanism to achieve the target. 1![Fig. 1: Reverse Linear Regression Block Diagram c) Calculating New Feature Values The new sets of feature values are calculated as below: Calculating 1 st set of features: The proposed solution calculates x 1 (TV ads) for y(sales) = queried response value, x 2 (radio ads) = radio ads expense from nearest observation obtained above and X 3 = Newspaper ads expense from nearest observation obtained above. Thus, Predicted_x 1 = [y -{w 0 + w 2 .x 2 (Radio ads) + w 3 .x 3 (Newspaper ads)}]/w 1 The 1 st set of predicted feature values [Predicted_x 1 , x 2 , x 3 ]](image-2.png "Fig. 1 :") * RobertTibshirani * Introduction to Statistical Learning TrevorHastie 2013