FeatureSelectionGA icon indicating copy to clipboard operation
FeatureSelectionGA copied to clipboard

TypeError: unhashable type: 'slice'

Open chunyanyin11 opened this issue 6 years ago • 6 comments

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)

chunyanyin11 avatar Dec 21 '18 13:12 chunyanyin11

Which line of code is throwing the error?

kaushalshetty avatar Dec 23 '18 16:12 kaushalshetty

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

chunyanyin11 avatar Dec 25 '18 01:12 chunyanyin11

It is not running on regression problem, how can I run it on regression model?

Sanjay1995 avatar Mar 25 '19 08:03 Sanjay1995

@kaushalshetty we may need to add example to use this for regression task.

PuneethaPai avatar Sep 30 '20 09:09 PuneethaPai

@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!

pandaseal avatar Mar 19 '21 15:03 pandaseal

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.

AliHaider20 avatar May 08 '21 02:05 AliHaider20