I have a binary classification task with 2 datasets (train.csv and test.csv). the training data contains independent variables (x1, x2, x3) and a target variable (y) while the test only contains the independent variables. I want to make predictions(logistic Regression) on both data. The only problem is that my test data doesn't have a target var. I'm not sure how to approach this task since my data has already been split and they have different number of rows. How do I make predictions on the test set if I'm missing the target variable? sample data below: You can use any module to demonstrate this, it doesn't matter. I just want to see the approach e.g sklearn.
data1 = {'x1':['Male', 'Female', 'Male', 'Female', 'Male', 'Male', 'Male', 'Female', 'Male', 'Female'],
'x2':[13, 20, 21, 19, 18, 78, 22, 33, 56, 10],
'x3': [335.5, 455.3, 109.4, 228.0, 220.9, -1.223, 700.4, 446.9, 499.1, 776.4],
'y': [1, 0, 0, 1, 0, 0, 0, 1, 0, 0,]
}
train = pd.DataFrame(data1) train
data2 = {'x1':['Female', 'Female', 'Male', 'Male', 'Male'],
'x2':[16, 20, 33, 29, 18, ],
'x3': [235.1, 395.0, 290.3, 118.6, 345.1]
}
test = pd.DataFrame(data2) test