# Algorithms

1. **Weighted Averaging**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd0cxUMHaaRIq7JCtuBX2OtpYoPqlgNiy9EB7hbCJs64JxS67MvVOeN34gaYV1Fp8NlCOrh7mCJ9H6j_6sJ2JWYkLWuSbiPhz_A3kY-8mQul8p8oQDDy2_4Hbv2Yzqhubwy9L3_?key=frsQALeYNJXbQDdnLKtbPB5H)

* Where:

wi: Weight of DL Module i.

Output: Output from DL Module i.

2. **Example**

If DL Module 1 predicts a 5% market increase (weight 0.6) and DL Module 2 predicts a 3% increase (weight 0.4), the Fusion Modules will combine them as follows:

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfCG5LDfY234P4TlXY8IAfUwkZAanKhMXf0qvr1fxkJq8I7vVmrx2HrqdgkXzFhma0hRJ6Shw1cpvG9oMI6iaJXkH-HEyR75qFgMq-dsva81DEVR-YHXY9X9Hpw-HxDB2WFVsKfJg?key=frsQALeYNJXbQDdnLKtbPB5H)

3. **Voting Mechanism**

* When modules provide different predictions, the Fusion Module selects the result with the highest "consensus." For example:
* DL Module 1 and DL Module 3 predict an increase in stock price.
* DL Module 2 predicts a decrease in price.
* → The Fusion Module will select the "increase" prediction because it has a 2/3 module consensus.

4. **Stacking models**

* A meta-model learns how to combine the outputs from the DL Modules. This meta-model can be a simple machine learning model like logistic regression or a more complex one like gradient boosting.

**Example:**

* The meta-model learns that during stable market periods, DL Module 1 has higher reliability, but when the market is volatile, DL Module 2 is more reliable.
