Redes Bayesianas
Una librería para construir redes bayesianas y realizar inferencia probabilística.
Instalación
Con el manejador de paquetes pip:
- pip install bayesian-networks-rey20074
Uso
from src.bayesian_networks_rey20074.BayesianNetwork import BayesianNetwork, Node
node_b = Node("b", 0.001)
node_e = Node("e", 0.002)
node_a = Node("a", multiple_parents=True)
node_a.add_connection_multiple_parents({"b": True, "e": True}, 0.95)
node_a.add_connection_multiple_parents({"b": True, "e": False}, 0.94)
node_a.add_connection_multiple_parents({"b": False, "e": True}, 0.29)
node_a.add_connection_multiple_parents({"b": False, "e": False}, 0.001)
node_a.add_connection("j", 0.9, True)
node_a.add_connection("j", 0.05, False)
node_a.add_connection("m", 0.7, True)
node_a.add_connection("m", 0.01, False)
node_j = Node("j")
node_m = Node("m")
network = BayesianNetwork()
network.add_node(node_a)
network.add_node(node_b)
network.add_node(node_e)
network.add_node(node_j)
network.add_node(node_m)
print('## GET PROBABILISTIC INFERENCE')
print(network.probabilistic_inference("m"))
print('\n## GET COMPACT REPRESENTATION')
representation = network.get_compact_representation()
print(representation)
print('## GET ELEMENTS USED FOR ALGORITHM')
collections = network.get_all_representations()
for x in collections:
print(x)
print('\n## GET IS FULLY DESCRIBED')
desc = network.is_fully_described()
if (desc == True):
print("Red Bayesiana Descriptiva")
else:
print("Red Bayesiana No Descriptiva")
API
Se incluyen las siguientes clases
Clase Node
- init(self, title: str, probability_of_success: float = None, multiple_parents: bool = False)
- add_connection(self, next_node_title: str, probability_of_success: float, parent_was_succesful: bool)
- get_children(self)
- get_children_title(self)
- delete_connection(self, node_title: str)
- delete_connection(self, node_title: str, parent_was_succesful: bool)
- add_connection_multiple_parents(self, parent_nodes: dict, probability_of_success: float)
- edit_connection(self, node_title: str, probability_of_success: float)
Clase BayesianNetwork
- init(self)
- get_nodes(self)
- get_node(self, node_title: str)
- delete_node(self, node_title: str)
- add_node(self, node: Node)
- replace_node(self, node_title: str, new_node: Node)
- get_parent(self, child_node_title: str)
- get_parents(self, child_node_title: str)
- one_parent_probabilistic_inference(self, node_title: str
- multiply_list(myList: list)
- multiple_parents_probabilistic_inference(self, node_title: str)
- probabilistic_inference(self, node_title: str)
- get_compact_representation(network)
- is_fully_described(self)
Metadata
Release files for bayesian-networks-rey20074 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bayesian_networks_rey20074-0.1.5.tar.gz | 5.0 kB | Without provenance | Details for bayesian_networks_rey20074-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bayesian_networks_rey20074-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for bayesian_networks_rey20074-0.1.5-py3-none-any.whl |
Total release size: 10.7 kB
Release files / bayesian_networks_rey20074-0.1.5.tar.gz
| Download URL | bayesian_networks_rey20074-0.1.5.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37800181cf4b259678c17e16c80e9f0df93293cb769acdee07e89275be0dc40b
|
|
BLAKE2b-256 checksum How to use checksums |
756ba586c9dc018cad4d271b692f0f45e04f80a7b93ed897d7673b5dfc994ccc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / bayesian_networks_rey20074-0.1.5-py3-none-any.whl
| Download URL | bayesian_networks_rey20074-0.1.5-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
031064bc18f3b3471c43a9273b4bb8f411f9cc6a35410f4ae14fd5fcb6059fe5
|
|
BLAKE2b-256 checksum How to use checksums |
453e3a1ace9847ae60fd2da6f201d421ebb3a44f8d9bb3c9b108ba52f62b1a5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for bayesian-networks-rey20074 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.