0

I am using pycaret for anomaly detection. But I cannot successfully setup the pycaret environment without it throwing up an error. I am using mice data from pycaret module. My code is show below:

# import dataset
from pycaret.datasets import get_data
dataset = get_data('mice')

# setup environment
from pycaret.anomaly import *
env_setup = setup(data,normalize = True,ignore_features = ["MouseID"],session_id = 123,silent=True)

When I run the setup code, this is what is outputs in colab:

INFO:logs:PyCaret Supervised Module
INFO:logs:ML Usecase: anomaly
INFO:logs:version 2.3.10
INFO:logs:Initializing setup()
INFO:logs:setup(target=None, ml_usecase=anomaly, available_plots={'tsne': 'Anomaly TSnE (3d)', 'umap': 'UMAP Dimensionality'}, train_size=0.7, test_data=None, preprocess=True, imputation_type=simple, iterative_imputation_iters=5, categorical_features=None, categorical_imputation=mode, categorical_iterative_imputer=lightgbm, ordinal_features=None, high_cardinality_features=None, high_cardinality_method=frequency, numeric_features=None, numeric_imputation=mean, numeric_iterative_imputer=lightgbm, date_features=None, ignore_features=['MouseID'], normalize=True, normalize_method=zscore, transformation=False, transformation_method=yeo-johnson, handle_unknown_categorical=True, unknown_categorical_method=least_frequent, pca=False, pca_method=linear, pca_components=None, ignore_low_variance=False, combine_rare_levels=False, rare_level_threshold=0.1, bin_numeric_features=None, remove_outliers=False, outliers_threshold=0.05, remove_multicollinearity=False, multicollinearity_threshold=0.9, remove_perfect_collinearity=False, create_clusters=False, cluster_iter=20, polynomial_features=False, polynomial_degree=2, trigonometry_features=False, polynomial_threshold=0.1, group_features=None, group_names=None, feature_selection=False, feature_selection_threshold=0.8, feature_selection_method=classic, feature_interaction=False, feature_ratio=False, interaction_threshold=0.01, fix_imbalance=False, fix_imbalance_method=None, transform_target=False, transform_target_method=box-cox, data_split_shuffle=False, data_split_stratify=False, fold_strategy=kfold, fold=10, fold_shuffle=False, fold_groups=None, n_jobs=-1, use_gpu=False, custom_pipeline=None, html=True, session_id=123, log_experiment=False, experiment_name=None, experiment_custom_tags=None, log_plots=False, log_profile=False, log_data=False, silent=True, verbose=True, profile=False, profile_kwargs=None, display=None)
INFO:logs:Checking environment
INFO:logs:python_version: 3.7.15
INFO:logs:python_build: ('default', 'Oct 12 2022 19:14:55')
INFO:logs:machine: x86_64
INFO:logs:platform: Linux-5.10.133+-x86_64-with-Ubuntu-18.04-bionic
INFO:logs:Memory: svmem(total=13616361472, available=11813752832, percent=13.2, used=1635651584, free=6350897152, active=829239296, inactive=6017949696, buffers=109645824, cached=5520166912, shared=1327104, slab=290172928)
INFO:logs:Physical Core: 1
INFO:logs:Logical Core: 2
INFO:logs:Checking libraries
INFO:logs:pd==1.3.5
INFO:logs:numpy==1.21.6
INFO:logs:sklearn==0.23.2
INFO:logs:lightgbm==3.3.3
WARNING:logs:catboost not found
INFO:logs:xgboost==0.90
INFO:logs:mlflow==1.30.0
INFO:logs:Checking Exceptions
INFO:logs:Declaring global variables
INFO:logs:USI: 417d
INFO:logs:pycaret_globals: {'dashboard_logger', '_all_metrics', 'display_container', 'transform_target_param', '_gpu_n_jobs_param', 'gpu_param', 'pycaret_globals', 'html_param', 'data_before_preprocess', 'imputation_regressor', 'create_model_container', 'stratify_param', 'fold_generator', 'fix_imbalance_param', 'n_jobs_param', 'fold_shuffle_param', 'fix_imbalance_method_param', 'fold_groups_param', 'log_plots_param', '_internal_pipeline', 'imputation_classifier', 'fold_groups_param_full', 'target_param', 'iterative_imputation_iters_param', 'fold_param', 'transform_target_method_param', '_ml_usecase', '_all_models_internal', 'USI', 'prep_pipe', 'logging_param', 'seed', 'experiment__', 'exp_name_log', '_available_plots', 'master_model_container', '_all_models', 'X'}
INFO:logs:Preparing display monitor
INFO:logs:Preparing display monitor
Processing:
Initiated   . . . . . . . . . . . . . . . . . . 13:12:06
Status  . . . . . . . . . . . . . . . . . . Preprocessing Data
INFO:logs:Importing libraries
INFO:logs:Copying data for preprocessing
INFO:logs:Declaring preprocessing parameters
INFO:logs:Creating preprocessing pipeline
INFO:logs:Preprocessing pipeline created successfully
ERROR:logs:(Process Exit): setup has been interupted with user command 'quit'. setup must rerun.
INFO:logs:Creating global containers
INFO:logs:Internal pipeline: Pipeline(memory=None, steps=[('empty_step', 'passthrough')], verbose=False)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-34-db76c0cb10c2> in <module>
      1 from pycaret.anomaly import *
----> 2 env_setup = setup(data,normalize = True,ignore_features = ["MouseID"],session_id = 123,silent=True)

6 frames
/usr/local/lib/python3.7/dist-packages/numba/__init__.py in <module>
     40 
     41 # Re-export vectorize decorators and the thread layer querying function
---> 42 from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
     43                             get_num_threads, set_num_threads,
     44                             set_parallel_chunksize, get_parallel_chunksize,

ImportError: cannot import name 'set_parallel_chunksize' from 'numba.np.ufunc' (/usr/local/lib/python3.7/dist-packages/numba/np/ufunc/__init__.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

I have installed and loaded both numpy and numba libraries, but I still get this error message. Even when it detects the class of the data, when I try to stop it by either pressing enter or typing "quit", I still get this error message. Please, what am I not doing write? Thanks for your help.

Idiaye
  • 39
  • 8

0 Answers0