Once the data is split into training and testing sets, you can train your machine learning model using the training data. After training, you can use the testing data to evaluate the model's performance. For example, you can make predictions on the testing data using the trained model and then compare those predictions with the actual target values to measure metrics such as accuracy, precision, recall, or F1 score.
Here's an example code snippet illustrating the evaluation process using a simple classifier:
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
# Instantiate the model
model = LogisticRegression()
# Fit the model on the training data
model.fit(X_train, y_train)
# Make predictions on the testing data
y_pred = model.predict(X_test)
# Calculate accuracy
accuracy = accuracy_score(y_test, y_pred)
print("Accuracy:", accuracy)
In this example, we're using logistic regression as the classifier, but the evaluation process can be applied to any type of machine learning model. The accuracy_score function from scikit-learn is used to calculate the accuracy by comparing the predicted labels (y_pred) with the actual labels (y_test).
Remember, evaluation metrics and techniques can vary depending on the problem and the type of machine learning model being used.