So at the step where we have to reuse the metric function in Excercise 4,
I have tried to play around with the metric function but almost every time I get a type of error
# Loop through each sample for i in range(len(feature_performance_arr)): # complete this line # permute the column of dataframe X perm_X = np.random.permutation(X[feature]) print(perm_X.shape) # calculate the performance with the permuted data # Use the same metric function that was used earlier print(perm_X.reshape(-1,1).shape) print(y.shape) feature_performance_arr[i] = metric(y,model.predict_proba(perm_X.reshape(-1,1))[i, 1])
so I think the main issue is with my metric function down there but haven’t figured out the fix. Currently, this is the error I get “ValueError: X has 1 feature per sample; expecting 2”
but I thought the whole point was to get the performance of one feature at a time for N num_samples
what am I missing here?