Enterprise Artificial Intelligence and Machine Learning for Managers

I decided to read this short book published by C3.ai that is focused for managers. The book focuses on concepts and gives you the basic nomenclature to understand how these type of initiatives are implemented. Later, when you review the product list of C3 company, you realize where they are classified in terms of the standard AI classification.

Below, some notes of the concepts I would like to review in future.

The Author is Nikhil Krishnan, PhD.

Machine Learning categories

Common categories of Machine Learning algorithms

Main types of supervised learning

Supervised learning algorithms learn by tuning a set of model parameters that operate on the model’s inputs, and that best fit the set of outputs.

Examples of classification and regression techniques

Unsupervised learning

Unsupervised learning techniques operate without known outputs or observations – that is, these techniques are not trying to predict any specific outcomes. Instead, unsupervised techniques attempt to uncover patterns within data sets.

Unsupervised techniques include clustering algorithms that group data in meaningful ways.

Clustering algorithms

Unsupervised machine learning models do not require labels to train on past data. Instead, they automatically
detect patterns in data to generate predictions.

Dimensionality reduction

Dimensionality reduction is a powerful approach to construct a low-dimensional representation of high-dimensional input data. The purpose of dimensionality reduction is to reduce noise so that a model can identify strong signals among complex inputs – i.e., to identify useful information.

High dimensionality poses two challenges. First, it is hard for a person to conceptualize high-dimensional space, meaning that interpreting a model is non-intuitive. Second, algorithms have a hard time learning patterns when there are many sources of input data relative to the amount of available training data.

Example of an unsupervised machine learning model for anomaly detection.

Reinforcement learning

Reinforcement learning (RL) is a category of machine learning that uses a trial-and-error approach. RL is a more goal-directed learning approach than either supervised or unsupervised machine learning.

Deep Learning

Deep learning is a subset of machine learning that involves the application of complex, multi-layered artificial neural networks to solve problems.

Deep learning takes advantage of yet another step change in compute capabilities. Deep learning models are typically compute-intensive to train and much harder to interpret than conventional approaches.

A deep learning neural network is a collection of many nodes. The nodes are organized into layers, and the outputs from neurons in one layer become the inputs for the nodes in the next layer.

Single nodes are combined to form input, output, and hidden layers of a deep learning neural network.

Financial data on tradingview

This is the first code I have created to show financial information of companies on Tradingview.

To start with something basic I have entered just some data: revenue, gross profit, operating income, EBITDA, and free cashflow.

This link contains the financial data you can use on PINE.

What can you check on the selection pane?

On “period”, you can show the data related to:

  • the fiscal quarters
  • or the fiscal years.

You can select a pack of financial data that I have organized in sections:

  • Revenue & earnings
  • EPS & DPS (EPS, EPS estimate, DPS and dividend payout ratio )
  • Debt (total debt, total equity and cash & equivalents)
  • Returns (ROE, ROIC, ROA and R&D revenue to ratio)

. I recommend to just select one of them, in other case the chart is a mess.

Some screenshots

An example of the “Revenue & Earnings” chart (values in millions):

An example of “EPS & DPS” chart, than contains:

  • Earning per share basic
  • Earning estimate (so you can see if the met the target, passed or missed).
  • Dividend per share.
  • Dividend payout ratio.

An example of debt and equities (values in millions):

An example of what I have called “Returns”, that is ROE, ROIC, ROA and R&D revenue to ratio:

The code

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © @joapen www.joapen.com

study("P1 Fundamentals", shorttitle="Fundamentals", precision=6, overlay=false)
MILLION = 1000000

// ---------- Inputs
output = input(defval="Per Share", title='Output type', options=["Per Share", "% of mcap", "Actual"])
// select data by fiscal quarter or by fiscal year
period = input(defval="FQ", title='Period', options=["FQ", "FY"])
// Show labels only last today
showLabel = year(time) == year(timenow) and month(time) == month(timenow) and dayofmonth(time) == dayofmonth(timenow)

// ---------- Variable initializations
// In case you want to add more data you can see all parameters available on the link below
// https://www.tradingview.com/pine-script-reference/v4/?solution=43000564727#fun_financial

// Revenue and Earnings History and Analysis
rev = financial(syminfo.tickerid, "TOTAL_REVENUE", period) / MILLION
grossProfit = financial(syminfo.tickerid, "GROSS_PROFIT", period) / MILLION
ebitda = financial(syminfo.tickerid, "EBITDA", period) / MILLION
op_expenses = financial(syminfo.tickerid, "OPERATING_EXPENSES", period) / MILLION * -1
fcf = financial(syminfo.tickerid, "FREE_CASH_FLOW", period) / MILLION

// Show it? then plot it //
showR_E = input(true, title = "Show Revenue & Earnings?")
plot(showR_E?rev:na, title="Revenue", color=color.blue, linewidth=3, style=plot.style_area, transp=90)
plot(showR_E?rev:na, title="Revenue", color=color.purple, linewidth=3, style=plot.style_linebr)
plot(showR_E?grossProfit:na, title="Gross Profit", color=color.blue, linewidth=3, style=plot.style_linebr)
plot(showR_E?ebitda:na, title="EBITDA", color=color.aqua, linewidth=3, style=plot.style_linebr)
plot(showR_E?op_expenses:na, title="Operating Expenses", color=color.orange, linewidth=3, style=plot.style_linebr)
plot(showR_E?fcf:na, title="FCF", color=color.lime, linewidth=3, style=plot.style_linebr)

if (showLabel and showR_E)
label revBox = label.new(x=bar_index, y=rev, text="Revenue", textalign=text.align_left, textcolor=color.white, color=color.purple, style=label.style_label_left, size=size.small)
label grossProfitBox = label.new(x=bar_index, y=grossProfit, text="Gross Profit", textalign=text.align_left, textcolor=color.white, color=color.blue, style=label.style_label_left, size=size.small)
label ebitdaBox = label.new(x=bar_index, y=ebitda, text="EBITDA", textalign=text.align_left, textcolor=color.black, color=color.aqua, style=label.style_label_left, size=size.small)
label op_expensesBox = label.new(x=bar_index, y=op_expenses, text="Op. Expenses", textalign=text.align_left, textcolor=color.black, color=color.orange, style=label.style_label_left, size=size.small)
label fcfBox = label.new(x=bar_index, y=fcf, text="FCF", textalign=text.align_left, textcolor=color.black, color=color.lime, style=label.style_label_left, size=size.small)

// EPS & DPS History and Analysis
eps = financial(syminfo.tickerid, "EARNINGS_PER_SHARE_BASIC", period)
epsE = financial(syminfo.tickerid, "EARNINGS_ESTIMATE", period)
dps = financial(syminfo.tickerid, "DPS_COMMON_STOCK_PRIM_ISSUE", period)
dpayout = financial(syminfo.tickerid, "DIVIDEND_PAYOUT_RATIO", period) / 100

// Show it? then plot it //
showE_D = input(false, title = "Show EPS & DPS?")
plot(showE_D?eps:na, title="EPS", color=color.blue, linewidth=3, style=plot.style_linebr)
plot(showE_D?epsE:na, title="EPSE", color=color.teal, linewidth=1, style=plot.style_linebr)
plot(showE_D?dps:na, title="DPS", color=color.orange, linewidth=3, style=plot.style_linebr)
plot(showE_D?dpayout:na, title="Dividend payout ratio", color=color.red, linewidth=2, style=plot.style_linebr)

if (showLabel and showE_D)
label epsBox = label.new(x=bar_index, y=eps, text="EPS", textalign=text.align_left, textcolor=color.white, color=color.blue, style=label.style_label_left, size=size.small)
label epsEBox = label.new(x=bar_index, y=epsE, text="Estimated EPS", textalign=text.align_left, textcolor=color.white, color=color.teal, style=label.style_label_left, size=size.small)
label dpsBox = label.new(x=bar_index, y=dps, text="DPS", textalign=text.align_left, textcolor=color.black, color=color.orange, style=label.style_label_left, size=size.small)
label dpayoutBox = label.new(x=bar_index, y=dpayout, text="Div. Payout", textalign=text.align_left, textcolor=color.white, color=color.red, style=label.style_label_left, size=size.small)

// Debt to Equity History and Analysis
totalDebt = financial(syminfo.tickerid, "TOTAL_DEBT", period) / MILLION
totalEquity = financial(syminfo.tickerid, "TOTAL_EQUITY", period) / MILLION
cash_and_equivalents = financial(syminfo.tickerid, "CASH_N_SHORT_TERM_INVEST", period) / MILLION
// Show it? then plot it //
showDebt = input(false, title = "Show Debt?")
plot(showDebt?totalDebt:na, title="Total Debt", color=color.red, linewidth=3, style=plot.style_linebr)
plot(showDebt?totalEquity:na, title="Total Equity", color=color.blue, linewidth=3, style=plot.style_linebr)
plot(showDebt?cash_and_equivalents:na, title="cash & equivalents", color=color.lime, linewidth=3, style=plot.style_linebr)

if (showLabel and showDebt)
label totalDebtBox = label.new(x=bar_index, y=totalDebt, text="Total Debt", textalign=text.align_left, textcolor=color.white, color=color.red, style=label.style_label_left, size=size.small)
label totalEquityBox = label.new(x=bar_index, y=totalEquity, text="Total Equity", textalign=text.align_left, textcolor=color.white, color=color.blue, style=label.style_label_left, size=size.small)
label cash_and_equivalentsBox = label.new(x=bar_index, y=cash_and_equivalents, text="Cash & Equivalents", textalign=text.align_left, textcolor=color.white, color=color.lime, style=label.style_label_left, size=size.small)

// Returns History and Analysis
roe = financial(syminfo.tickerid, "RETURN_ON_EQUITY", period) / 100
roic = financial(syminfo.tickerid, "RETURN_ON_INVESTED_CAPITAL", period) / 100
roa = financial(syminfo.tickerid, "RETURN_ON_ASSETS", period) / 100
RandDtoRevenueRatio = financial(syminfo.tickerid, "RESEARCH_AND_DEVELOP_TO_REVENUE", period) / 100

// Show it? then plot it //
showReturn = input(false, title = "Show Returns?")
plot(showReturn?roe:na, title="ROE", color=color.blue, linewidth=3, style=plot.style_linebr)
plot(showReturn?roic:na, title="ROIC", color=color.teal, linewidth=3, style=plot.style_linebr)
plot(showReturn?roa:na, title="ROA", color=color.purple, linewidth=3, style=plot.style_linebr)
plot(showReturn?RandDtoRevenueRatio:na, title="R&D revenue to ratio", color=color.green, linewidth=3, style=plot.style_linebr)
hline(showReturn?0.2:na, color=color.orange, linewidth=2)

if (showLabel and showReturn)
label roeBox = label.new(x=bar_index, y=roe, text="ROE", textalign=text.align_left, textcolor=color.white, color=color.blue, style=label.style_label_left, size=size.small)
label roicBox = label.new(x=bar_index, y=roic, text="ROIC", textalign=text.align_left, textcolor=color.white, color=color.teal, style=label.style_label_left, size=size.small)
label roaBox = label.new(x=bar_index, y=roa, text="ROA", textalign=text.align_left, textcolor=color.white, color=color.purple, style=label.style_label_left, size=size.small)
label RandDtoRevenueRatioBox = label.new(x=bar_index, y=RandDtoRevenueRatio, text="R&D to Revenue Ratio", textalign=text.align_left, textcolor=color.white, color=color.green, style=label.style_label_left, size=size.small)


Any suggestion of improvement is welcome.

How to bring back benefits of social media companies to people

This is an idea, maybe a crazy one, but here we go.

I see social media companies are an useful tools and they have enabled so many positive things, but in some uses they are a problem society, not only by the use given by an end user, but by the controller of the tool itself.

So many people are talking about this and how these companies are able to dictate their own rules, laws and apply them without control; there are not separation of duties and they are not based on the principles that the countries have given to themselves.

I wrote a little bit about it in October, trying to dig in the issue and understand better the roots of the issue.

To do it, I used this map created by Simon Wardley that I modified to show where a company as Facebook is acting around so many principles of our society.

There is an antitrust case that is in the early stages between 46 states of US and Facebook where basically the states accuse Facebook of suppressing its competition through monopolistic business practices.

There are specialists and journalists claiming that Facebook, Alphabet, Amazon should be split into different parts so some competition could grow around them. I do not see this to be easy in case of Alphabet neither Facebook. The quick minds think that separating Facebook into Facebook 2.0, Instagram and WhatsApp is the right thing to do, but I do not see this move useful for anybody. The reason? a new social media giant will appear, acquiring competition again and in 10 years we will have the same problem.

With the available cash that Facebook has right now they can acquire so many relevant competitor that challenges them. Go to a website and check, they have right now around 55.000 million dollar cash. What do you want to acquire?

You can say, “What is the proposed solution you have for this?”, well I have a crazy idea about it, and I hope you can challenge it.

I would like to start reviewing the Real State Investment Trust (REIT) first.

Real State Investment Trust (REIT)

REITs were established by US Congress in 1960 to give all investors, especially small investors, access to income-producing real estate. It was a manner in which the best attributes of real estate and stock-based investment are combined.

Before REITs the benefits of commercial real estate investment to regular Americans were not available, you had to access to these type of investments through large financial intermediaries and this was only accessible to wealthy individuals.

With the creation of REITs these profitable assets were accessible to more people.

This legislation have evolved since the first tax reform act. Since then, the U.S. REIT approach has flourished and served as the model for around 40 countries around the world (even Spain created them, they are called SOCIMI).

In total, REITs of all types collectively own more than $3.5 trillion in gross assets across the U.S. (not bad right?).

REITs must pay out at least 90 % of their taxable income to shareholders—and most pay out 100%. In turn, shareholders pay the income taxes on those dividends. This fact attracts to many small investors as it’s a business easy to understand and enable them to have some extra income.

My point is that the government was able to make accessible to the small investors a high amount of valuable assets, in a moment where the Real State prices where going up too much and they were creating a lot of wealth to just some citizens.

Right now in 2020, there is a problem with the social media, where each individual feeds these platforms and they are not able to access to the benefits of these companies. You can argue that you can buy stocks of Facebook, Twitter or any other social media company, and make some money with the change of price of that stock. But to me this is not enough, you just can see the percentage of free cash flow these companies are reporting: it’s huge!!!

I repeat: it’s huge amount of money that they generate and they do not share with the people. Other companies are not able to provide a consistent amount of FCF. You can check it.

The free cash flow is the money that they have in the pocket after investing in all operations, R&D, financial investment, etc. They have so much money that they do not know what to do with it (remember the 55.000 million dollars Facebook has right now?).

At this point you can say, “what is your crazy idea about it?”

Social Media Investment Trust (SMIT)

The federal government should create an investment vehicle called SMIT that forced all social media to pay out at least 90 % of their taxable income to shareholders.

In this way, the companies share the profits with the citizens that wants to own these type of stocks. It will continue to be a huge profitable business where the society could benefit on it.

In this way I’m sure the management teams of these companies will invest more money on R&D projects, which will contribute to the future too.

Social Media Investment Trust, Wardley Map

Would you invest on these type of companies?

You do not like to buy stocks? Ok, no problem I’m sure another financial vehicles will be created as ETF or any other one that adapt to your investor profile.

Arguments against this idea

  1. Companies will reject it. I’m sure, as the real state companies did in 1960. But Dwight D. Eisenhower though that REIT creation was a good thing for the country.
  2. Companies will not be able to compete: this is not true, the REIT industry has demonstrated that this works, and remember, if you own a 1 of a social media stock, you will receive regular dividends; in case you have thousand of these stocks, you will receive millions of dollars in dividends. In fact I think that this will attract a lot of investors and the prices will blow up as a rocket.
  3. Companies will not be competitive: that’s not true, they can invest on R&D, they can acquire companies, and execute their plans as today, you just can look at the REITs.

I recognize is a crazy idea that the companies will not accept, but my point is that in this way Social media companies can bring back some of the benefits that they are taking to the people that are in fact the people that feed these platforms with data. Right now the the scale is very unbalanced.



Maps and civilization

I have picked this book to learn about maps and improve my knowledge on cartography, and see if it helps on the deeper understanding of Wardley Maps.

The amount and quality of data on the book is great and the author is so concise and direct, so you do not lose time reading extra pages that do not provide value.

If you want to learn about cartography basis, this book is for you.

Trading learning year 3

After a good 2019 learning about how to trade, this 2020 was fine in so many ways, that I would like to review.

The math result? I did a 36%,

2020 started with $1.420,94
and ended with   $1.934,41
so the P&L was $513,47   or a 36,1%

Total moves 188
wins 157     84%
loses   31    16%

This is the screen with the main data of win/loss events:

I have ordered by date of long move and the main major losses come from issues related to the crash happened in March.

Some data

Best values I traded:

TicketGross Margin

Worst values I traded:

TicketGross Margin

The number of moves by month were:

Month# moves

Portfolio data month by month

MonthStartedEndedDif ($)Dif (%)
Oct 14011353-48-3%

Some lessons from data:

  1. I have to stop loss better than I did, this happened to me in 2019 too.
  2. Portfolio management was better done in second half of the year and it gave me more consistent small wins.
  3. To pay attention to ex-date gave me a nice 47$ of dividends.
  4. The average of earnings have been 1,99$ in comparison with 2019 is worst (2,32%).
  5. 10% of the worst moves made me lose 705$ which is a lot.
  6. I have to improve on the way I’m trading, I still have some negative skew.
  7. The rally I did during the last 3 months enabled me to recuperate of a disaster. I have to focus myself on what I did well during Q4 because it worked.
  8. I have learned to read better the market timing indicators and this valuation has enabled me to exit and enter in values with better results.


  • My 2019 trades were quite better than 2020 in so many ways: benefit, number of errors and bias.
  • I have to concentrate more on the process and avoid the noise.

What to expect for 2021?

  • I have increase the funds with 2000$, so we will start the year with 3934$.
  • I will use the same percentage when opening positions: 1%, 2%, 3%.


Year 4, Q1 personal readjustments and Artificial Intelligence

During my last learning slot I was focusing on the Wardley maps learning, the generation of content, the increase of deep knowledge and practice of mapping. This has been the second quarter I focused on it and I have the feeling I have a speed of work that can let me go to another chapter.

This quarter I want to do some readjustments about how I work on my priorities and learnings, focusing on habits and my schedule. Why? I have the feeling I’m working in a way that is not focused on the things that are more important and I need to readjust some habits to improve on the real priorities of my life.

This doesn’t mean that I will not add specific learning on a field of knowledge, I will do it, and I was thinking about it so much during Christmas. The focus this time is going to be around some specific areas of Artificial Intelligence. Artificial Intelligence is a broad knowledge field, so I want to understand the topologies of the different areas and review the learnings I did during 2018.

So the V2MOM for this quarter will be:

  • Vision: Readjust a set of habits and learn about Artificial Intelligence areas.
  • Values: have fun, change habits day by day.
  • Method:
    • For the readjustments, use the principles and suggestions I learned from Triggers book. Add to it some meditation.
    • Artificial Intelligence: read about AI and gain perspective of the work being done, draw some maps that provides me context and understand how these type of projects are planned and executed.
  • Obstacles:
    • Time,
    • Aversion to do some activities that are not comfortable to me.
    • Ariel’s surgery.
  • Measures:
    • Readjustments of behavior:
      • Reschedule the day agenda (once it’s defined, check how much is followed). There are 60 labor days this quarter, so at least do 45 days.
      • Follow the “Daily questions” challenge. There are 90 days this quarter, so complete it at least 70 days.
      • Take the meditation audios and complete at least 70 days.
      • Follow the measures on a notebook: reduce time on computer.
    • Artificial Intelligence:
      • Read 1 book related to the area (1 per quarter).
      • Listen 13 hours of Artificial Intelligence podcasts (1 per week).
      • Draw at least 3 maps related to a specific topic on Artificial Intelligence (1 per month).

Death line = 31/March/2021

Results (April 2021)

  • Measures (Actual / target):
    • .


New era of discovery: data around our behavior

By the end of the 15th century, America had been discovered by Europeans and a sea route to India had been found. For the next three hundred years, most of the world’s coasts were visited and mapped, if only roughly, by explorers from Portugal, Spain, Italy, Holland, France, and England. Through the exploitation of overseas areas, Europe went from being a poor province of Eurasia during the Middle Ages to being the most influential area in the world during the 17th, 18th and 19th centuries.

At the beginning of the 21st century, an attempt is being made to map the behavior of people individually and as a whole, and this time it is not physical sovereignties, but digital ones that embark on projects to discover and map each and every one of us. .

There is still much to discover yet.

This photo left me cold today:

Every day I think more about digital sovereignty as a concept that must be developed and understood its rules of the game, and be aware that our map of the world right now is something like this:

Apple product evolution

Disclaimer: this is not a Wardley map!!

This is a graphic representation of the products commercialized by Apple, adding some information that helps us to gain perspective.

I have classified them by the nature of software technologies, simplifying it too much.

This is the graph:

  • Each product has been represented since its first release till 2015, coloring it by the 4 stages mentioned in Wardley maps (genesis, development, product, basic service).
  • I added the at the bottom the period where Steve Jobs and Tim Cook where the CEO of the company.
  • Revenue information (taken from macrotrends.net, no more than 2005)
  • The number of acquisitions done by Apple by year (on the table) and classified by the nature of the technology on the graph.


If you know something about the history of the company, you know that we can see two different ways of leading the company, as the personality and purpose of the CEOs where significantly different. We can argue that what Apple is Today is thanks to what Steve Jobs did during his years of dedication to Apple, but we can also say that what Apple is Today is thanks to what Tim Cook is been doing during these last 9 years.

We can see that since 2013, the number of acquisitions done by Apple have increased in numbers. We can think that the company size was bigger so they were better positioned to do these purchases.

Some people says that Apple is not innovating, the argument I listen is that they really are not adding any new product to the market since so many years. But when you look at the type of companies they are acquiring, you can notice that the investment on Artificial Intelligence, Augmented Reality and Virtual Reality is there. It does not mean that they will succeed, but they are doing their job to invest and innovate.

This is an unpopular opinion, but I will write it down. I think that Steve Jobs created superior products and things that changed the way the electronic devices were used. I think nobody rejects this point. But I have the opinion that Tim Cook did an excellent job as CEO to provide value to its shareholders and turned Apple in a machine of doing money quarter by quarter. I think this is not well recognized as the job done by Steve. Nowadays, for instance so many people recognize the impact of Satya Nadella in Microsoft, but no at the same level that Tim Cook is doing in Apple.

Some people have told me, why Warren Buffett came in into Apple in 2019 and not before. Was this a mistake, or it was done on purpose? I would like to say that the people in Berkshire Hathaway are not stupid, and I have not the answer, but I can figure out that Apple demonstrated to them that they are transitioning from product company to service company where the users consume products and services as a basic thing in their lives. Berkshire loves cash cows and Apple now is that cash cow that they love to have in their portfolio.