소개
게시글
질문&답변
2022.09.01
Mac에서의 Putty 사용관련
빠른 답변에 감사드립니다!!
- 1
- 3
- 252
질문&답변
2022.08.30
LightGBM의 boosting 파라미터 관련
빠른 답변에 감사 드립니다 👍🏻
- 0
- 2
- 198
질문&답변
2022.08.22
imblearn 관련
다운그레이드 후 정상 동작합니다!! 빠른 회신과 정확한 답변에 감탄했습니다. 정말 감사합니다 👍🏻
- 0
- 5
- 1.5K
질문&답변
2022.08.22
imblearn 관련
오류 전체 메세지 입니다!! --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Input In [30] , in () 1 from imblearn . over_sampling import SMOTE 3 smote = SMOTE(random_state = 0 ) ----> 4 X_train_over, y_train_over = smote . fit_resample ( X_train , y_train ) 5 print ( ' SMOTE 적용 전 학습용 피처/레이블 데이터 세트: ' , X_train . shape, y_train . shape) 6 print ( ' SMOTE 적용 후 학습용 피처/레이블 데이터 세트: ' , X_train_over . shape, y_train_over . shape) File ~/opt/anaconda3/lib/python3.9/site-packages/imblearn/base.py:83 , in SamplerMixin.fit_resample (self, X, y) 77 X, y, binarize_y = self . _check_X_y(X, y) 79 self . sampling_strategy_ = check_sampling_strategy( 80 self . sampling_strategy, y, self . _sampling_type 81 ) ---> 83 output = self . _fit_resample ( X , y ) 85 y_ = ( 86 label_binarize(output[ 1 ], classes = np . unique(y)) if binarize_y else output[ 1 ] 87 ) 89 X_, y_ = arrays_transformer . transform(output[ 0 ], y_) File ~/opt/anaconda3/lib/python3.9/site-packages/imblearn/over_sampling/_smote/base.py:324 , in SMOTE._fit_resample (self, X, y) 321 X_class = _safe_indexing(X, target_class_indices) 323 self . nn_k_ . fit(X_class) --> 324 nns = self . nn_k_ . kneighbors ( X_class , return_distance = False ) [:, 1 :] 325 X_new, y_new = self . _make_samples( 326 X_class, y . dtype, class_sample, X_class, nns, n_samples, 1.0 327 ) 328 X_resampled . append(X_new) File ~/opt/anaconda3/lib/python3.9/site-packages/sklearn/neighbors/_base.py:763 , in KNeighborsMixin.kneighbors (self, X, n_neighbors, return_distance) 756 use_pairwise_distances_reductions = ( 757 self . _fit_method == " brute " 758 and PairwiseDistancesArgKmin . is_usable_for( 759 X if X is not None else self . _fit_X, self . _fit_X, self . effective_metric_ 760 ) 761 ) 762 if use_pairwise_distances_reductions: --> 763 results = PairwiseDistancesArgKmin . compute ( 764 X = X , 765 Y = self . _fit_X , 766 k = n_neighbors , 767 metric = self . effective_metric_ , 768 metric_kwargs = self . effective_metric_params_ , 769 strategy = " auto " , 770 return_distance = return_distance , 771 ) 773 elif ( 774 self . _fit_method == " brute " and self . metric == " precomputed " and issparse(X) 775 ): 776 results = _kneighbors_from_graph( 777 X, n_neighbors = n_neighbors, return_distance = return_distance 778 ) File sklearn/metrics/_pairwise_distances_reduction.pyx:698 , in sklearn.metrics._pairwise_distances_reduction.PairwiseDistancesArgKmin.compute () File ~/opt/anaconda3/lib/python3.9/site-packages/sklearn/utils/fixes.py:151 , in threadpool_limits (limits, user_api) 149 return controller . limit(limits = limits, user_api = user_api) 150 else : --> 151 return threadpoolctl . threadpool_limits ( limits = limits , user_api = user_api ) File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:171 , in threadpool_limits.__init__ (self, limits, user_api) 167 def __init__ ( self , limits = None , user_api = None ): 168 self . _limits, self . _user_api, self . _prefixes = \ 169 self . _check_params(limits, user_api) --> 171 self . _original_info = self . _set_threadpool_limits ( ) File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:268 , in threadpool_limits._set_threadpool_limits (self) 265 if self . _limits is None : 266 return None --> 268 modules = _ThreadpoolInfo ( prefixes = self . _prefixes , 269 user_api = self . _user_api ) 270 for module in modules: 271 # self._limits is a dict {key: num_threads} where key is either 272 # a prefix or a user_api. If a module matches both, the limit 273 # corresponding to the prefix is chosed. 274 if module . prefix in self . _limits: File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:340 , in _ThreadpoolInfo.__init__ (self, user_api, prefixes, modules) 337 self . user_api = [] if user_api is None else user_api 339 self . modules = [] --> 340 self . _load_modules ( ) 341 self . _warn_if_incompatible_openmp() 342 else : File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:371 , in _ThreadpoolInfo._load_modules (self) 369 """Loop through loaded libraries and store supported ones""" 370 if sys . platform == " darwin " : --> 371 self . _find_modules_with_dyld ( ) 372 elif sys . platform == " win32 " : 373 self . _find_modules_with_enum_process_module_ex() File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:428 , in _ThreadpoolInfo._find_modules_with_dyld (self) 425 filepath = filepath . decode( " utf-8 " ) 427 # Store the module if it is supported and selected --> 428 self . _make_module_from_path ( filepath ) File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:515 , in _ThreadpoolInfo._make_module_from_path (self, filepath) 513 if prefix in self . prefixes or user_api in self . user_api: 514 module_class = globals ()[module_class] --> 515 module = module_class ( filepath , prefix , user_api , internal_api ) 516 self . modules . append(module) File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:606 , in _Module.__init__ (self, filepath, prefix, user_api, internal_api) 604 self . internal_api = internal_api 605 self . _dynlib = ctypes . CDLL(filepath, mode = _RTLD_NOLOAD) --> 606 self . version = self . get_version ( ) 607 self . num_threads = self . get_num_threads() 608 self . _get_extra_info() File ~/opt/anaconda3/lib/python3.9/site-packages/threadpoolctl.py:646 , in _OpenBLASModule.get_version (self) 643 get_config = getattr ( self . _dynlib, " openblas_get_config " , 644 lambda : None ) 645 get_config . restype = ctypes . c_char_p --> 646 config = get_config ( ) . split () 647 if config[ 0 ] == b " OpenBLAS " : 648 return config[ 1 ] . decode( " utf-8 " ) AttributeError : 'NoneType' object has no attribute 'split'
- 0
- 5
- 1.5K
질문&답변
2022.08.22
imblearn 관련
Imblearn과 scikit-learn 모두 Version Update 하였으며, Version은 아래와 같습니다. 아래와 같이 동일한 오류가 발생하고 있습니다. imbalanced-learn : 0.9.1 scikit-learn : 1.1.2 (사진) (사진)
- 0
- 5
- 1.5K