每当我尝试清洁单个CSV文件时,每当尝试并预测概率时,我都会遇到值错误。我有什么办法可以在一个CSV文件上训练模型,保留该模型,然后在另一个CSV文件中收集一些测试数据,然后通过我使用第一个文件训练的模型将后一个文件提供给我?
P.S。重要的是,我不要使用train_test_split,因为我需要有关每个单独类的信息(因为它们具有I.D)。
答案 0 :(得分:0)
按照以下步骤
# Training csv
train = read_csv('train.csv')
# Transform and clean data
# Fit function
# Testing csv
test = pd.read_csv('test.csv')
# Transform and fit the data
# Predict and score using the testing data