6) Suppose you have training and test data X and Y, where X contains 3 features and Y contains the corresponding labels which are either 0 or 1. Y is the dependent variable. Write pseudo code to train the model and predict use logistic regression.

Here's a basic pseudo code to train a logistic regression model and make predictions:

1. Import the necessary libraries:
- import numpy as np
- from sklearn.linear_model import LogisticRegression

2. Split the data into training and test sets:
- from sklearn.model_selection import train_test_split
- X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=0.2)

3. Instantiate the logistic regression model:
- model = LogisticRegression()

4. Train the model using the training data:
- model.fit(X_train, y_train)

5. Make predictions on the test data:
- predictions = model.predict(X_test)

6. Evaluate the model's performance:
- from sklearn.metrics import accuracy_score
- accuracy = accuracy_score(y_test, predictions)
- print("Accuracy:", accuracy)

Note: Before implementing the pseudo code, make sure to preprocess the data, handle missing values, scale the features, etc., if needed. It's also important to select the appropriate hyperparameters and perform cross-validation if required.