Menu

Training the Logistic Regression Model

Training the Logistic Regression Model

Now that the data has been prepared, train the Logistic Regression model.

Code

model = LogisticRegression()

model.fit(

X_train,

Y_train

)

Explanation

The model learns the relationship between the transaction features and the target variable.

After training, it can classify new transactions as either genuine or fraudulent.