You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trained the model to predict Attrition and using DiCE for counterfactuals
d = dice_ml.Data(dataframe=df, outcome_name='Backed_out_before_Round2',continuous_features=['Age', 'Worked_in_field', 'Major', 'GPA', 'Projects', 'Experience'])
m = dice_ml.Model(model=xgb, backend="sklearn")
exp = dice_ml.Dice(d, m, method="random")
query=df[1:2].drop(['Attrition'],axis=1)
e = exp.generate_counterfactuals(query, total_CFs=1, desired_class="opposite",random_seed=0)
e.visualize_as_dataframe(show_only_changes=True)
0%| | 0/1 [00:00<?, ?it/s]
ValueError Traceback (most recent call last)
Cell In[162], line 1
.......
183 msg = """DataFrame.dtypes for data must be int, float or bool.
184 Did not expect the data types in fields """
--> 185 raise ValueError(msg + ', '.join(bad_fields))
187 if feature_names is None and meta is None:
188 if isinstance(data.columns, MultiIndex):
ValueError: DataFrame.dtypes for data must be int, float or bool.
Did not expect the data types in fields Bootcamp, Ethnicity, BusinessTravel, DailyRate, Department, DistanceFromHome, Education, EducationField, EnvironmentSatisfaction, Gender, HourlyRate, JobInvolvement, JobLevel, JobRole, JobSatisfaction
Issue : Even though columns are of datatype int64, int8 the error is somewhat not clear.
The text was updated successfully, but these errors were encountered:
Dataframe has below columns :
Age int64
Worked_in_field int64
Major int64
GPA float64
Projects int64
Experience int64
Bootcamp int64
Ethnicity int8
BusinessTravel int8
DailyRate int64
Department int8
DistanceFromHome int64
Education int64
EducationField int8
EnvironmentSatisfaction int64
Gender int8
HourlyRate int64
JobInvolvement int64
JobLevel int64
JobRole int8
JobSatisfaction int64
Attrition int64
Trained the model to predict Attrition and using DiCE for counterfactuals
d = dice_ml.Data(dataframe=df, outcome_name='Backed_out_before_Round2',continuous_features=['Age', 'Worked_in_field', 'Major', 'GPA', 'Projects', 'Experience'])
m = dice_ml.Model(model=xgb, backend="sklearn")
exp = dice_ml.Dice(d, m, method="random")
query=df[1:2].drop(['Attrition'],axis=1)
e = exp.generate_counterfactuals(query, total_CFs=1, desired_class="opposite",random_seed=0)
e.visualize_as_dataframe(show_only_changes=True)
0%| | 0/1 [00:00<?, ?it/s]
ValueError Traceback (most recent call last)
Cell In[162], line 1
.......
183 msg = """DataFrame.dtypes for data must be int, float or bool.
184 Did not expect the data types in fields """
--> 185 raise ValueError(msg + ', '.join(bad_fields))
187 if feature_names is None and meta is None:
188 if isinstance(data.columns, MultiIndex):
ValueError: DataFrame.dtypes for data must be int, float or bool.
Did not expect the data types in fields Bootcamp, Ethnicity, BusinessTravel, DailyRate, Department, DistanceFromHome, Education, EducationField, EnvironmentSatisfaction, Gender, HourlyRate, JobInvolvement, JobLevel, JobRole, JobSatisfaction
Issue : Even though columns are of datatype int64, int8 the error is somewhat not clear.
The text was updated successfully, but these errors were encountered: