How can I apply already trained classifier on the new dataset?
Verfasst: Dienstag 13. September 2022, 10:54
Hey, I am new to machine learning and it is my first project, so I would be grateful if someone can give me some advice.
I have already trained the classifier on the labelled dataset using a SVC model and got the accuracy with the train-test-split method. So it looks something like this:
X_train, X_test, y_train, y_test = train_test_split(features, y, test_size=0.2, random_state=2)
scaler = StandardScaler()
scaler.fit(X_train)
X_train_std = sc.transform(X_train)
X_test_std = sc.transform(X_test)
svc=SVC(C=1.0, random_state=1, kernel='sigmoid')
svc.fit(X_train_std, y_train)
prediction = svc.predict(X_test_std)
And now I want to apply this classifier to another dataset, which is not labelled. I did already preprocess steps with the new dataset, just as I did it with the first one, but I don't understand how can I apply this classifier to the new dataset and also get the labels from this classifier for the new dataset.
I have already trained the classifier on the labelled dataset using a SVC model and got the accuracy with the train-test-split method. So it looks something like this:
X_train, X_test, y_train, y_test = train_test_split(features, y, test_size=0.2, random_state=2)
scaler = StandardScaler()
scaler.fit(X_train)
X_train_std = sc.transform(X_train)
X_test_std = sc.transform(X_test)
svc=SVC(C=1.0, random_state=1, kernel='sigmoid')
svc.fit(X_train_std, y_train)
prediction = svc.predict(X_test_std)
And now I want to apply this classifier to another dataset, which is not labelled. I did already preprocess steps with the new dataset, just as I did it with the first one, but I don't understand how can I apply this classifier to the new dataset and also get the labels from this classifier for the new dataset.