'Problems with logistic regression in Titanic dataset
I'm an aspiring data scientist. I stumbled across the titanic dataset. I tried to use logistic regression for the problem. However, I got stuck.
Since I have two different datasets, I didn't use the train-test-split function
In the code below I can show you where I got stuck after getting my datasets (train and test) ready to undergo logistic regression:
lr = LogisticRegression(C=100, random_state=42, solver="liblinear",
max_iter=1000)
lr.fit(X_train, y_train)
mms = MinMaxScaler()
X_train = mms.fit_transform(X_train)
X_test = mms.transform(X_test)
I want to make a prediction of the people who survived during the titanic sinking.
I trained the model using the train dataset and I want to use this model to make a prediction on the test dataset
I don't have information about the survival outcome in the test dataset
X_train and X_test are the datasets with all the information about the passengers
y_train is the NumPy array with the survival outcome of the passengers in the X_train dataset
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
