Skip to content

Commit

Permalink
imports statements in docs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman223 committed Sep 22, 2023
1 parent 754cb62 commit d8384ff
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/source/examples/add_ml_models_to_nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ First, lets import BAMT modules and required machine learning modules.

.. code-block:: python
from bamt.networks.hybrid_bn import HybridBN
import bamt.networks as networks
import bamt.Preprocessors as pp
import pandas as pd
Expand Down Expand Up @@ -66,7 +66,7 @@ Next, we initialize Bayesian Network object and add nodes to it.

.. code-block:: python
bn = HybridBN(has_logit=True, use_mixture=True)
bn = networks.HybridBN(has_logit=True, use_mixture=True)
bn.add_nodes(info)
After adding nodes we can perform structure learning.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/learn_params_vis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Used imports:

.. code-block:: python
from bamt.networks.hybrid_bn import HybridBN
import bamt.networks as networks
import bamt.Preprocessors as pp
import pandas as pd
Expand Down Expand Up @@ -44,7 +44,7 @@ Preprocessing data, encode categorical features and discretize numerical feature
p = pp.Preprocessor([('encoder', encoder), ('discretizer', discretizer)])
discretized_data, est = p.apply(data)
bn = HybridBN(has_logit=True, use_mixture=True) # init BN
bn = networks.HybridBN(has_logit=True, use_mixture=True) # init BN
info = p.info
info
bn.add_nodes(info)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/learn_sampling_predict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Used imports:

.. code-block:: python
from bamt.networks.hybrid_bn import HybridBN
import bamt.networks as networks
import bamt.Preprocessors as pp
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/learn_save.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Used imports:
from bamt.preprocessors import Preprocessor
import pandas as pd
from sklearn import preprocessing as pp
from bamt.networks.hybrid_bn import HybridBN
from bamt.networks import HybridBN
Let's start with data loading and preprocessing:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/read_structure_and_params.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Used imports:
from bamt.preprocessors import Preprocessor
import pandas as pd
from sklearn import preprocessing as pp
from bamt.networks.hybrid_bn import HybridBN
from bamt.networks import HybridBN
import json
You can read the pre-trained structure and distribution parameters from a file.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/read_structure_param_learning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Used imports:
from bamt.preprocessors import Preprocessor
import pandas as pd
from sklearn import preprocessing as pp
from bamt.networks.hybrid_bn import HybridBN
from bamt.networks import HybridBN
import json
There are two options for loading a BN structure. The first is to read it directly from a JSON file:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/models/bayesiannetworks/base_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ For Example:

.. code-block:: python
from bamt.networks.discrete_bn import DiscreteBN
import bamt.networks as networks
import bamt.preprocessors as pp
import pandas as pd
Expand All @@ -38,7 +38,7 @@ For Example:
p = pp.Preprocessor([('encoder', encoder), ('discretizer', discretizer)])
discretized_data, est = p.apply(asia)
bn = DiscreteBN()
bn = networks.DiscreteBN()
info = p.info
info
Expand Down
4 changes: 2 additions & 2 deletions docs/source/models/bayesiannetworks/composite_bn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ To initialize a ``CompositeBN`` object, you can use the following code:

.. code-block:: python
from bamt.networks.composite_bn import CompositeBN
import bamt.networks as networks
bn = CompositeBN()
bn = networks.CompositeBN()
Data Preprocessing
Expand Down
4 changes: 2 additions & 2 deletions docs/source/models/bayesiannetworks/continuous_bn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ To initialize a ``ContinuousBN`` object, you can use the following code:

.. code-block:: python
from bamt.networks.continuous_bn import ContinuousBN
import bamt.networks as networks
bn = ContinuousBN(use_mixture=True)
bn = networks.ContinuousBN(use_mixture=True)
ContinuousBN has an additional parameter ``use_mixture``.
It is used to determine whether to use mixuters of Gaussian distributions to represent the conditional distribution of continuous variables.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/models/bayesiannetworks/discrete_bn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ To initialize a ``DiscreteBN`` object, you can use the following code:

.. code-block:: python
from bamt.networks.discrete_bn import DiscreteBN
import bamt.networks as networks
bn = DiscreteBN()
bn = networks.DiscreteBN()
Data Preprocessing
~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/source/models/bayesiannetworks/hybrid_bn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ To initialize a ``HybridBN`` object, you can use the following code:

.. code-block:: python
from bamt.networks.hybrid_bn import HybridBN
import bamt.networks as networks
bn = HybridBN(has_logit=True, use_mixture=True)
bn = networks.HybridBN(has_logit=True, use_mixture=True)
HybridBN has two additional parameters ``has_logit`` and ``use_mixture``.
``has_logit`` is used to determine whether to use logit nodes. Logit nodes use machine learning algorithms to represent variable.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/models/bayesiannetworks/large_bn_algs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Then perform structure learning as usual, but use ``ps`` as ``white_list``:

.. code-block:: python
bn = Nets.ContinuousBN()
bn = networks.ContinuousBN()
bn.add_nodes(descriptor=info)
Expand Down

0 comments on commit d8384ff

Please sign in to comment.