I am trying to apply feature selection method using SelectKBest with chi2 to select top 15 features from the data but it comes with an error
ValueError: Input X must be non-negative
Can any one help me out with this error. Below is the code that i have used
x = data.drop('TARGET_B', axis='columns')
x = x.drop('TARGET_D', axis='columns')
y= data.TARGET_B
x_train, x_test, y_train, y_test = model_selection.train_test_split(x,
y, test_size=0.20, random_state=None)
select_feature = SelectKBest(chi2, k=15).fit(x_train, y_train)