# Artificial Neural Networks: Some Misconceptions (Part 5)

# Artificial Neural Networks: Some Misconceptions (Part 5)

### Neural networks are a class of powerful algorithms. Let's articulate some misconceptions to help you implement neural networks meet with success.

Join the DZone community and get the full member experience.

Join For FreeStart coding something amazing with the IBM library of open source AI code patterns. Content provided by IBM.

Time for the last post in the series!

## 9. Neural Networks Are Not Black Boxes

By itself, a neural network is a black box. This presents problems for people wanting to use them. For example, fund managers wouldn’t know how a neural network makes trading decisions, so it is impossible to assess the risks of the trading strategies learned by the neural network. Similarly, banks using neural networks for credit risk modelling would not be able to justify why a customer has a particular credit rating, which is a regulatory requirement. That having been said, state-of-the-art rule-extraction algorithms have been developed to vitrify some neural network architectures. These algorithms extract knowledge from the neural networks as either mathematical expressions, symbolic logic, fuzzy logic, or decision trees.

*This image shows a neural network as a black box and how it related to rule extraction techniques.*

**Mathematical rules**: Algorithms have been developed that can extract multiple linear regression lines from neural networks. The problem with these techniques is that the rules are often still difficult to understand; therefore, these do not solve the "black-box" problem.**Propositional logic**: Propositional logic is a branch of mathematical logic that deals with operations done on discrete valued variables. These variables, such as A or B, are often either TRUE or FALSE, but they could occupy values within a discrete range, e.g. {BUY,HOLD,SELL}.

Logical operations can then be applied to those variables such as OR, AND, and XOR. The results are called predicates and can also be quantified over sets using the exists or for-all quantifiers. This is the difference between predicate and propositional logic. If we had a simple neural network which Price (P), Simple Moving Average (SMA), and Exponential Moving Average (EMA) as inputs and we extracted a trend following strategy from the neural network in propositional logic, we might get rules like this,

**Fuzzy logic**: Fuzzy logic is where probability and propositional logic meet. The problem with propositional logic is that is deals in absolutes, e.g. BUY or SELL, TRUE or FALSE, 0 or 1. Therefore, for traders, there is no way to determine the confidence of these results. Fuzzy logic overcomes this limitation by introducing a membership function that specifies how much a variable belongs to a particular domain. For example, a company (GOOG) might belong 0.7 to the domain {BUY} and 0.3 to the domain {SELL}. Combinations of neural networks and fuzzy logic are called Neuro-Fuzzy systems. This research survey discusses various fuzzy rule extraction techniques.**Decision trees**: Decision trees show how decisions are made when given certain information. This article describes how to evolve security analysis decision trees using genetic programming. Decision tree induction is the term given to the process of extracting decision trees from neural networks.

An example of a simple trading strategy represented using a decision tree. The triangular boxes represent decision nodes; these could be to BUY, HOLD, or SELL a company. Each box represents a tuple of <indicator, inequality,=”” value=””>. An example might be <sma,>, 25> or <ema, <=”,” 30=””>.

## 10. Neural Networks Are Not Hard to Implement

Speaking from experience, neural networks are quite challenging to code from scratch. Luckily, there are now hundreds open-source and proprietary packages which make working with neural networks a lot easier. Here is a list of packages that quants may find useful for quantitative finance. The list is *not* exhaustive and is ordered alphabetically. If you have any additional comments, or frameworks to add, please share via the comment section.

As I mentioned, there are now hundreds of machine learning packages and frameworks out there. Before committing to any one solution, I would recommend doing a best-fit analysis to see which open-source or proprietary machine learning package or software best matches your use cases. Generally speaking, a good rule to follow in software engineering and model development for quantitative finance is to not reinvent the wheel. That said, for any sufficiently advanced model you should expect to have to write some of your own code.

## Conclusion

Neural networks are a class of powerful machine learning algorithms. They are based on solid statistical foundations and have been applied successfully in financial models as well as in trading strategies for many years. Despite this, they have a bad reputation due to the many unsuccessful attempts to use them in practice. In most cases, unsuccessful neural network implementations can be traced back to inappropriate neural network design decisions and general misconceptions about how they work. This article aims to articulate some of these misconceptions in the hopes that they might help individuals implementing neural networks meet with success.

Start coding something amazing with the IBM library of open source AI code patterns. Content provided by IBM.

Opinions expressed by DZone contributors are their own.

## {{ parent.title || parent.header.title}}

## {{ parent.tldr }}

## {{ parent.linkDescription }}

{{ parent.urlSource.name }}