I try to use correlation to extract features , but I faced this problem: please help me, how I can fix it?
AttributeError: module 'numpy' has no attribute 'corroef'
This my code to correlate the features::
cor_list = []
feature_name = X_train[0]
print(feature_name)
#calculate the correlation with y for each feature
for i in feature_name:
cor = np.corroef(X_train[i], y_train)[0, 1]
cor_list.append(cor)
#replace NaN with 0
cor_list = [0 if np.isnan(i) else i for i in cor_list]
#feature_name
cor_feature = X_train.iloc[:np.argsort(np.abs(cor_list))[-num_feats:]].columns.tolist()
return cor_feature ```