You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a BNClassifier class that inherits from HybridBN and ClassifierMixin
Its fit method includes add_edges method from HybridBN
I get the following error (with Hill Climbing only):
File "<HIDE>", line 59, in fit
self.add_edges(df, scoring_function=('BIC',), params={'init_edges': <HIDE>})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/networks/base.py", line 193, in add_edges
worker.build(
File "<HIDE>/lib/python3.11/site-packages/bamt/builders/hc_builder.py", line 198, in build
self.apply_group1(data=data, progress_bar=progress_bar, **self.params)
File "<HIDE>/lib/python3.11/site-packages/bamt/builders/hc_builder.py", line 121, in apply_group1
bn = hc_method(
^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/redef_HC.py", line 165, in hc
cache[old_cols] = mutual_information(data[:, old_cols])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/redef_info_scores.py", line 130, in BIC_local
log_score = log_lik_local(data, method=method)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/redef_info_scores.py", line 123, in log_lik_local
mutual_information(data, method=method)
File "<HIDE>/lib/python3.11/site-packages/bamt/mi_entropy_gauss.py", line 224, in mi_gauss
return mi_gauss(loc_to_DataFrame(data), method, conditional)
^^^^^^^^^^^^^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/preprocess/numpy_pandas.py", line 16, in loc_to_DataFrame
nodes_type = get_type_numpy(data)
^^^^^^^^^^^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/preprocess/numpy_pandas.py", line 50, in get_type_numpy
all_row_is_integer = all(
^^^^
File "<HIDE>/lib/python3.11/site-packages/bamt/preprocess/numpy_pandas.py", line 51, in <genexpr>
np.issubdtype(x, np.integer) or x.is_integer() for x in row
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<HIDE>/lib/python3.11/site-packages/numpy/core/numerictypes.py", line 417, in issubdtype
arg1 = dtype(arg1).type
^^^^^^^^^^^
TypeError: Cannot interpret '39' as a data type
39 is the value of the second column (an np.dtypes.Int32DType column) in the first row
Datatypes in my DataFrame are:
np.dtypes.Float32DType for continuous data
np.dtypes.Int32DType for discrete numerical data
np.dtypes.ObjectDType for categorical data
The text was updated successfully, but these errors were encountered:
I have a
BNClassifier
class that inherits fromHybridBN
andClassifierMixin
Its
fit
method includesadd_edges
method fromHybridBN
I get the following error (with Hill Climbing only):
39
is the value of the second column (annp.dtypes.Int32DType
column) in the first rowDatatypes in my
DataFrame
are:np.dtypes.Float32DType
for continuous datanp.dtypes.Int32DType
for discrete numerical datanp.dtypes.ObjectDType
for categorical dataThe text was updated successfully, but these errors were encountered: