Question: TODO 7 ( 1 0 points ) : get _ preprocessed _ data function Complete the following the get _ preprocessed _ data ( )

TODO 7(10 points): get_preprocessed_data function
Complete the following the get_preprocessed_data() function which reimplementing each data preprocessing step.
Call the add_bias() function to add the bias column to the training and testing data. Store the output back into and xtst.
def get_preprocessed_data():TODO 7.2
return x_trn, y_trn, x_tst, y_tst
def TEST_get_preprocessed_data():
X_trn, y_trn, X_tst, y_tst = get_preprocessed_data()
print(f"X_trn shape: {X_trn.shape}")
print(f"y_trn shape: {y_trn.shape}")
print(f"X_tst shape: {X_tst.shape}")
print(f"y_tst shape: {y_tst.shape}")
print(f"X_trn means:
{X_trn.mean(axis=0)}")
print(f"X_tst means:
{X_tst.mean(axis=0)}")
todo_check([
("len(y_trn)==16512", "Training data has incorrect number of data samples."),
("len(y_tst)==4128", "Testing data has incorrect number of data samples."),
("(X_trn[:,0]==1).all()", "The 1st column of does not seem to be the bias term (i.e., full of 1s)."),
("(X_tst[:,0]==1).all()", "The 1st column of does not seem to be the bias term (i.e., full of 1s)."),
],**locals())
TEST_get_preprocessed_data()
TODO 7 ( 1 0 points ) : get _ preprocessed _ data

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!