Minyus / causallift

CausalLift: Python package for causality-based Uplift Modeling in real-world business
https://causallift.readthedocs.io/
Other
333 stars 42 forks source link

Getting Json Formatter error #25

Open ukamath opened 1 year ago

ukamath commented 1 year ago

Using Google Colab to run basic Uplift modeling.

try: import causallift except: """ Install CausalLift """ !pip3 install causallift

'1.0.6'

from causallift import CausalLift

print('\n[Estimate propensity scores for Inverse Probability Weighting.]') cl = CausalLift(train_df, test_df, enable_ipw=True, verbose=3)

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ :4 in │ │ │ │ /usr/local/lib/python3.8/dist-packages/causallift/causal_lift.py:510 in init │ │ │ │ 507 │ │ │ │ 508 │ │ # Instance attributes were defined above. │ │ 509 │ │ if logging_config: │ │ ❱ 510 │ │ │ logging.config.dictConfig(logging_config) │ │ 511 │ │ │ │ 512 │ │ args_raw = dict( │ │ 513 │ │ │ cols_features=cols_features, │ │ │ │ /usr/lib/python3.8/logging/config.py:808 in dictConfig │ │ │ │ 805 │ │ 806 def dictConfig(config): │ │ 807 │ """Configure logging using a dictionary.""" │ │ ❱ 808 │ dictConfigClass(config).configure() │ │ 809 │ │ 810 │ │ 811 def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None): │ │ │ │ /usr/lib/python3.8/logging/config.py:545 in configure │ │ │ │ 542 │ │ │ │ │ │ formatters[name] = self.configure_formatter( │ │ 543 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ formatters[name]) │ │ 544 │ │ │ │ │ except Exception as e: │ │ ❱ 545 │ │ │ │ │ │ raise ValueError('Unable to configure ' │ │ 546 │ │ │ │ │ │ │ │ │ │ 'formatter %r' % name) from e │ │ 547 │ │ │ │ # Next, do filters - they don't refer to anything else, either │ │ 548 │ │ │ │ filters = config.get('filters', EMPTY_DICT) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValueError: Unable to configure formatter 'json_formatter'

Minyus commented 1 year ago

The error could be returned if python-json-logger package (dependency of kedro version 0.18.2 or older) is not installed. Could you try installing these packages?

pip install python-json-logger==2.0.4 kedro==0.17.7 scikit-learn==0.21.3