@@ -1473,7 +1473,7 @@ class ColumnwiseNB(_BaseNB, _BaseComposition):
1473
1473
1474
1474
Parameters
1475
1475
----------
1476
- estimators : list of tuples
1476
+ estimatorNBs : list of tuples
1477
1477
List of (name, estimatorNB, columns) tuples specifying the naive Bayes
1478
1478
estimators to be combined into a single naive Bayes meta-estimator.
1479
1479
@@ -1592,15 +1592,15 @@ class ColumnwiseNB(_BaseNB, _BaseComposition):
1592
1592
[0 0 1 0 2 2]
1593
1593
"""
1594
1594
1595
- _required_parameters = ["estimatorsNB " ]
1595
+ _required_parameters = ["estimatorNBs " ]
1596
1596
1597
1597
def _log_message (self , name , idx , total ):
1598
1598
if not self .verbose :
1599
1599
return None
1600
1600
return "(%d of %d) Processing %s" % (idx , total , name )
1601
1601
1602
- def __init__ (self , estimators , priors = None , n_jobs = None , verbose = False ):
1603
- self .estimators = estimators
1602
+ def __init__ (self , estimatorNBs , priors = None , n_jobs = None , verbose = False ):
1603
+ self .estimatorNBs = estimatorNBs
1604
1604
self .priors = priors
1605
1605
self .n_jobs = n_jobs
1606
1606
self .verbose = verbose
@@ -1634,12 +1634,12 @@ def _joint_log_likelihood(self, X):
1634
1634
def _validate_estimators (self , check_partial = False ):
1635
1635
# Check if estimators have fit/partial_fit and jll methods
1636
1636
# Validate estimator names via _BaseComposition._validate_names(self, names)
1637
- if not self .estimators :
1637
+ if not self .estimatorNBs :
1638
1638
raise ValueError (
1639
1639
"A list of naive Bayes estimators must be provided "
1640
1640
"in the form [(name, estimatorNB, columns), ... ]."
1641
1641
)
1642
- names , estimators , _ = zip (* self .estimators )
1642
+ names , estimators , _ = zip (* self .estimatorNBs )
1643
1643
for e in estimators :
1644
1644
if (not check_partial ) and (
1645
1645
not (hasattr (e , "fit" ) and hasattr (e , "_joint_log_likelihood" ))
@@ -1671,7 +1671,7 @@ def _validate_column_callables(self, X):
1671
1671
# ColumnTransformer code.
1672
1672
all_columns = []
1673
1673
estimator_to_input_indices = {}
1674
- for name , _ , columns in self .estimators :
1674
+ for name , _ , columns in self .estimatorNBs :
1675
1675
if callable (columns ):
1676
1676
columns = columns (X )
1677
1677
all_columns .append (columns )
@@ -1743,7 +1743,7 @@ def _iter(self, *, fitted=False, replace_strings=False):
1743
1743
else :
1744
1744
yield (name , estimator , cols )
1745
1745
else : # fitted=False
1746
- for (name , estimator , _ ), cols in zip (self .estimators , self ._columns ):
1746
+ for (name , estimator , _ ), cols in zip (self .estimatorNBs , self ._columns ):
1747
1747
if replace_strings and _is_empty_column_selection (cols ):
1748
1748
continue
1749
1749
else :
@@ -1948,14 +1948,14 @@ def _estimators(self):
1948
1948
which expects lists of tuples of len 2.
1949
1949
"""
1950
1950
# Implemented in the image and likeness of ColumnTranformer._transformers
1951
- return [(name , e ) for name , e , _ in self .estimators ]
1951
+ return [(name , e ) for name , e , _ in self .estimatorNBs ]
1952
1952
1953
1953
@_estimators .setter
1954
1954
def _estimators (self , value ):
1955
1955
# Implemented in the image and likeness of ColumnTranformer._transformers
1956
1956
# TODO: Is renaming or changing the order legal? Swap `name` and `_`?
1957
- self .estimators = [
1958
- (name , e , col ) for ((name , e ), (_ , _ , col )) in zip (value , self .estimators )
1957
+ self .estimatorNBs = [
1958
+ (name , e , col ) for ((name , e ), (_ , _ , col )) in zip (value , self .estimatorNBs )
1959
1959
]
1960
1960
1961
1961
def get_params (self , deep = True ):
0 commit comments