# Logistic Regression Model on Test Set - in Titanic Data Showing Error

I have built the model on Titanic Data set , with Logistic Regression Succeffullly and it is giving prediction on training set , but unfortunately I am unable to implement this on test data set.

Following code for reference :

training = training[['PassengerId','Sex','Embarked','Pclass','Age','SibSp','Survived']] # 0.78
X = training.iloc[:, :-1]
y = training.iloc[:, -1]

from sklearn.compose import make_column_transformer
from sklearn.preprocessing import OneHotEncoder
ct = make_column_transformer((OneHotEncoder(), ['Sex', 'Embarked']), remainder = 'passthrough')
X = ct.fit_transform(X)

from sklearn.preprocessing import StandardScaler
sc =StandardScaler()
X=sc.fit_transform(X)

from sklearn.linear_model import LogisticRegression

logreg = LogisticRegression(solver = 'lbfgs')

from sklearn.model_selection import cross_val_score

cross_val_score(logreg, X,y, cv=5, scoring ='accuracy').mean()



As in the test data set , I don't have y data that means the predictive column so I introduced it with the help of null values.

But unable to take it forward, Can you please guide , how I can run Logistic Regression Model on test data set of Titanic.

Thanks a lot .

y_pred = logreg.predict(X_test)