Ask Your Question
4

What is the process of preparing test and train data that can predict the "next X days" for a logistic regression model in Python?

asked 2021-12-25 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-04-25 02:00:00 +0000

nofretete gravatar image

The process of preparing test and train data for a logistic regression model in Python that can predict the "next X days" can be divided into the following steps:

  1. Import the necessary libraries - Pandas, NumPy, and Sklearn.
  2. Load the dataset into a Pandas dataframe and clean/preprocess the data.
  3. Split the dataset into two parts: the training set and the test set.
  4. Identify the independent variables (features) and the dependent variable (target).
  5. Select the features that are relevant to the prediction task.
  6. Scale the feature values using standardization or normalization.
  7. Split the training set into subsets for training and validation.
  8. Train the logistic regression model on the training data using sklearn.
  9. Evaluate the performance of the model on the validation data.
  10. Use the trained model to predict the "next X days" on the test set.
  11. Evaluate the performance of the model on the test data.
  12. Fine-tune the model hyperparameters to improve performance.
  13. Deploy the model to predict future outcomes.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-25 11:00:00 +0000

Seen: 14 times

Last updated: Apr 25 '21