"The red and green lines that point in the direction of the corresponding sentiment are calculated using a perpendicular line to the separation line calculated in the previous equations (neg function). It must point in the same direction as the derivative of the Logit function, but the magnitude may differ. It is only for a visual representation of the model.

direction = pos * \theta_2 / \theta_1"

Could someone please explain to me how we get to the formula in direction?

The decision boundary is defined by the equation \theta_1 x_1 + \theta_2 x_2 + \theta_0 = 0. The direction vector (\theta_1, \theta_2), shows the gradient of the decision function.

To visualize the direction of the sentiment (+ / -), we scale this vector so it points in the same direction as the gradient of the LR, but the magnitude can vary. So, the formula direction = pos * \theta_2 / \theta_1 provides the slope of this direction vector, showing the model’s decision boundary in a way that aligns with the sentiment’s gradient.

Hope this helps, feel free to ask if you need further assistance!