FeatureSelectionGA
FeatureSelectionGA copied to clipboard
TypeError: unhashable type: 'slice'
Hello, when I ran your code got "TypeError: unhashable type: 'slice' ".Can you help me analyze the problem?thanks
import pandas as pd from sklearn.linear_model import LogisticRegression from feature_selection_ga import FeatureSelectionGA data = pd.read_excel("D:\\Project_CAD\\实验6\\data\\train_data_1\\train_1.xlsx") x, y = data.iloc[:, :53], data.iloc[:, 56] model = LogisticRegression() fsga = FeatureSelectionGA(model, x, y) pop = fsga.generate(100)
Which line of code is throwing the error?
OK,thank you .I Converted the dataframe data into numpy ,then the issue was solved. Now ,I have some other questions. 1. I how to get the best features ? 2. how to print the selected features? 3. Could I use your algorithm as a classifier ,and how to do ?Thank you very much
It is not running on regression problem, how can I run it on regression model?
@kaushalshetty we may need to add example to use this for regression task.
@kaushalshetty we may need to add example to use this for regression task.
Does it even do regression? What I found so far was that the FitnessFunction uses classification metrics.. Is it enough to write a custom fitness function or are there other obstacles? Thanks!
Can someone define the problem again here? Cause the issue opened at the top was solved so why is this issue is still open? If there's some other problem then plz share here.