Go to file
2019-05-09 15:58:45 +01:00
app MAJOR: first commit 2019-05-09 15:58:45 +01:00
CHANGELOG.md Update CHANGELOG 2019-05-09 07:52:36 -07:00
CONTRIBUTING.md Add CONTRIBUTING 2019-05-09 07:53:02 -07:00
LICENSE.md Add LICENSE 2019-05-09 07:53:59 -07:00
README.md Update README.md 2019-05-09 07:51:17 -07:00

Erlang Decision Tree and Baysian Networks

This repository have two different exercises in erlang:

1.Decision tree that maximizes the optimal point and consequently provides decision support based on the assumptions provided.

  • The probability of making a medication/treatment 1 and use is OK of 42%;
  • One possibility of making a medication/treatment 1 and of the user staying KO is 22.5%;
  • The probability of making a medication/treatment 1 and is not conclusive is 35.6%;
  • The probability of making a medication/treatment 2 and staying OK is 62%;
  • The probability of making a medication/treatment 2 and getting KO is 38%.

alt text

2.There are ways to get the probabilities knowing certain parameters (they do not indicate the optimal point, but calculate a probability of success depending on the existing resources) - using the baysian networks.

What is the probability of giving the patient M2 and is OK, knowing that:

  • The probability of administering M1 and the patient is OK is 20%;
  • The probability of administering M2 knowing that I administered M1 and the patient being OK is 70%;
  • The probability of administering M2 knowing that I did not administer M1 and the patient is OK of 20%.

Prerequisites

Basic knowledge of erlang, algorithm and statistics.

Install or use Docker

If you prefer install the erlang compiler, please search for the appropriate installation for your OS.

If you prefer you can use Docker to test this solution. Get a docker container and start the container: I suggest this container and run:

docker pull bitwalker/alpine-erlang
docker run --rm -it --user=root bitwalker/alpine-erlang

Run the solution

  1. For the first exercise (Decision Tree):
c(engine).
engine:doAll().

and the best solution is:

alt text

** You can do a medication 1 and medication 2 of 97.6% of success to be OK.**

  1. For the second exercise (Baysian Networks):
c(engine3).
engine3:getp({m2, ok}).

alt text

There is a 16% chance that the patient will be OK administering the drug M2.

Built With

Contributing

Please read CONTRIBUTING.md for details on my code of conduct, and the process for submitting pull requests to me.

Versioning

I use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details