# Understandable and explainable machine learning model

I want to find formula for best financial portfolio.

Inputs: Historical fundamental data for last 15 years. For 3000 companies for every quatal we have things like market cap, cash flow, liabilities, assets, revenue etc, every one of these inputs is a time series with data points for every quartal (i.e. 4 times in a year).

Goal: I want to find a formula that given the 3000 companies would allow me to rank (sort) it from best to worst. And then I can pick let's say top 10 of those as the best portfolio.

Example, how human can solve this task: study those historical financial data for couple of years, and came up with something. Like this very simple formula rank = revenue[last]/total-assets[last] + revenue[last]/market-cap[last] (looking for highly profitable and not too much overpriced companies).

Machine Learning way to solve it: feed those data points to Neural Net, run it and hope it will learn something after a while.

The problem is that we can't analyse the the neural network result because it's a black box. And I want to see the final formula in more or less compact form and be able to understand what it does.

What other technics other than Neural Nets can be used? The model has to be sophisticated enough to be able to work with the time series as inputs.

Neural networks are convenient for automatically building features from the data, but as far as I know this is not compatible with interpretability since we don't know what the features represent. So the only way I'm aware of to obtain predictions that can be explained and analyzed is to use traditional models, and this would certainly require a bit of feature engineering in this case. I would recommend decision trees which are completely transparent in their decision process and can be understood even by non-experts. With this kind of model the idea would be to provide the features which represent the evolution across time, e.g. min/max/average over the last N years, difference current-N, etc., possibly for several values of N.

I suggest in the very first place to reconsider and further think through your approach.

This is usually not the approach a company does it when going 'the human way':

Example, how human can solve this task: study those historical financial data for couple of years, and came up with something. Like this very simple formula rank = revenue[last]/total-assets[last] + revenue[last]/market-cap[last] (looking for highly profitable and not too much overpriced companies).

For good reasons! because it does not leverage any existing knowledge (e.g. from employees or literature) how to analyze assets and it is not well steered.

For similar reasons this is not a promising approach to solve it using ML:

Machine Learning way to solve it: feed those data points to Neural Net, run it and hope it will learn something after a while.

Because in this case you just throw an underspecified problem at an ML algorithm to do the thinking for you (no offense, but that is how it sounds to me).

Instead, what you first need to develop are hypotheses which can then be leveraged by the ML method. This can include feature design as suggested by @Erwan. For example you may hypothesize that the P/E ration is an important independent variable which you want to include as a feature for each asset.

So better develop a hypothesis (or a set of hypotheses) what makes a 'good company' and then use ML to see if there is support in your data for your hypothesis and how (or if) this you could be used as a predictor.

Another question is what type of ML problem you would like to consider this. From your description it sounds like a supervised problem. But you do not mention any labels for you data, e.g. defining an asset as 'good' or 'bad' to put it very simple. So that is another area that needs further specification.

Only after properly specifying your problem you can make a decision which ML method to use.

• For labels I was thinking using backtesting - and see how much money the given model would earn for let's say last 10 years. The more it earns the better the result Commented Nov 10, 2019 at 23:12