<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Let's find out how we did!
We'll first need to load up our old classifier. We've supplied code below to load up the same data used by ML-4. You should be able to copy and paste in your code where noted below. First we're going to load up the appropriate data to train your models again.
Step1:  Train your classifiers
Next you need to copy/paste in the code from your ML-4 Homework to train your classifiers on the data. Because we're using exactly the same data and you set a random seed, we can expect to get the same classifiers.
Step2:  Evaluate your classifiers
If you've followed instructions thus far, you should be able to simply run the code below to report your results.
<ASSISTANT_TASK:>
Python Code:
# numpy provides python tools to easily load comma separated files.
import numpy as np
# use numpy to load disease #1 data
d1 = np.loadtxt(open("../31_Data_ML-IV/D1.csv", "rb"), delimiter=",")
# features are all rows for columns before 200
# The canonical way to name this is that X is our matrix of
# examples by features.
X1 = d1[:,:200]
# labels are in all rows at the 200th column
# The canonical way to name this is that y is our vector of
# labels.
y1 = d1[:,200]
# use numpy to load disease #2 data
d2 = np.loadtxt(open("../31_Data_ML-IV/D2.csv", "rb"), delimiter=",")
# features are all rows for columns before 200
X2 = d2[:,:200]
# labels are in all rows at the 200th column
y2 = d2[:,200]
Explanation: Let's find out how we did!
We'll first need to load up our old classifier. We've supplied code below to load up the same data used by ML-4. You should be able to copy and paste in your code where noted below. First we're going to load up the appropriate data to train your models again.
End of explanation
# DATASET 1 CLASSIFIER CODE GOES HERE
# DATASET 2 CLASSIFIER CODE GOES HERE
Explanation: Train your classifiers
Next you need to copy/paste in the code from your ML-4 Homework to train your classifiers on the data. Because we're using exactly the same data and you set a random seed, we can expect to get the same classifiers.
End of explanation
d1_test = np.loadtxt(open("../32_Data_ML-V/D1_test.csv", "rb"), delimiter=",")
X1_test = d1_test[:,:200]
y1_test = d1_test[:,200]
d2_test = np.loadtxt(open("../32_Data_ML-V/D2_test.csv", "rb"), delimiter=",")
X2_test = d2_test[:,:200]
y2_test = d2_test[:,200]
d1_score = d1_classifier.score(X1_test, y1_test)
print("D1 Testing Accuracy: " + str(d1_score))
d2_score = d2_classifier.score(X2_test, y2_test)
print("D2 Testing Accuracy: " + str(d2_score))
Explanation: Evaluate your classifiers
If you've followed instructions thus far, you should be able to simply run the code below to report your results.
End of explanation
<END_TASK>