Skip to content

Commit

Permalink
update examples discritizer
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Oct 7, 2024
1 parent e8a997d commit 761d514
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions bnlearn/examples_discretize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@
import pandas as pd
import bnlearn as bn

df = pd.read_csv(
"bnlearn/tests/discretize/data/auto_mpg.csv",
dtype={
"mpg": "float64",
"cylinders": "int64",
"displacement": "float64",
"horsepower": "float64",
"weight": "float64",
"acceleration": "float64",
"model_year": "int64",
"origin": "int64",
},
)
#%%
df = bn.import_example('auto_mpg')
del df['origin']

edges = [
("cylinders", "displacement"),
Expand Down Expand Up @@ -74,3 +64,5 @@
evidence = {"weight": bn.discretize_value(df_disc["weight"], 3000.0)}
print(evidence)
print(bn.inference.fit(model_mle, variables=["mpg"], evidence=evidence, verbose=0))

# %%

0 comments on commit 761d514

Please sign in to comment.