fbdesignpro/sweetviz

sv.compare_intra without option "Target"

LeonG7 opened this issue · 2 comments

When i used this code
my_report = sv.compare_intra(data_train, data_train["Sex"] == "male", ["Male", "Female"],feature_config)
The error report is as follows:
KeyError:"Feature '<sweetviz.feature_config.FeatureConfig object at 0x7f98d0ee2198>' was specified as TARGET, but is NOT FOUND in the dataframe (watch case-sensitivity?)."

I think the target parameter is not added in the tutorial,so i tried this:
my_report = sv.compare_intra(data_train, data_train["Sex"] == "male", ["Male", "Female"],'Survived',feature_config)
It can be used normally

@LeonG7 if you don't want a target, but want a feature_cfg, you should be able to specify "None", e.g.

my_report = sv.compare_intra(data_train, data_train["Sex"] == "male", ["Male", "Female"], None, feature_config)

Let me know if that works!

Francois

Closing, as I believe this was the issue.