How do we get the coefficients and intercept in Logistic Regression?
Maybe this part of the code is trying to teach you activities post ML training i.e. prediction
The coefficient and intercept are the parameters of the Model. These are determined by using Training data (Features and Labels) and training process
You follow these steps(Very high level) -
 Get data - X , Y
 Define model i.e. Logistics Regression
 Train Model using the data - Here you get the Coef/Intercept
 Predict using the Model
In your work, you are at the last step.
 You have a model ready with the parameters and you also got the data i.e. Features(X)
 It is as good as calling a function i.e. get_answer(x) and get_answer is your model with it's parameters.
Then you say
if answer &gt; THRESOLD(normally 0.5 but we get the best by trials) it's Class-A else it's Class-B
You may learn Logistics regression from scratch form Blog-machinelearningmastery