Friday, 24 April 2020

Challenge accepted ! Build a Machine Learning Model to play Board Game

This board game is one of the games that I used to play and I'm still playing with my friends when I have time. Being a very popular board game in Eastern Europe, I have decided to do something different more exactly to build a robot or machine learning model to play this game.
Being influenced and have study case AlphaGo a computer program developed by DeepMind Technologies.  In 2017 AlphaGo shock the world by beaten the best Go chinese players . Go is a very popular game in China is about strategy and was invented 2,500 years ago. For China the defeat of their best players was a huge humiliation that was given by US. Since than The Chinese Communist Party has settled that by 2030 to be the leading power in artificial intelligence.

Ken Jie a chinese guy who has never beaten by a computer in Go game said he had "an horrible experience .  The next question we should ask our self is how AlphaGo did this ?
The reality is very simple the computer programs have always beat humans , that happen with Garry Kasparov. The secret of AlphaGo were deep neural networks , containing million of connections similar to the neurons of the brain.

Back to our example the rules of the Board Game are simple for this game you need a pair of dice and game chicks. In the above picture you have an image of how the game looks. Let's say you are with white chicks , you need to come with all your white and put them in the right side at the bottom and after than you start to clean the place, the winner is the first who finish.

In the process of building the model I will use machine learning which is sub field of artificial intelligence , linear algebra, probabilities and as programming language Python.
Machine learning models can have more methods depending of what type of problems you want to solve. This methods can be:

  • Supervised Learning
  • Unsupervised Learning
  • Semi-supervised learning
  • Reinforcement learning
In our case I will gone use reinforcement learning.

Reinforcement Learning

The reason why we use reinforcement learning is that we have an robot that we want to train over a period of time to interact with an environment in our case the board game and improve is performance over a period of time with actions performed by the environment (board game) . The first step is to teach the robot with rules of the game. Being familiarized by the rules and strategies of the game the robot start to become smarter and familiar with the game.

The main steps of the reinforcement learning:

  • Train the robot with rules and policies
  • Select optimal policy and perform action
  • Get corresponding reward(penalty)
  • Update policies if needed
  • Repeat steps until the robot learn most policies

Monday, 13 April 2020

Capital Gain vs Cashflow

Capital Gain vs Cashflow
We live in uncertain time, many economies are locked down due to government measures to try to stop Covid-19 spread. Many business have stopped their activities, some are on the verge of collapse, workers are laid off temporarily, social payments for unemployment pays have increased.
For many people to invest or start own business looks a crazy idea. To invest in this condition can provide you good investments opportunities.

In today article I will present my on view regarding investment activity. For many times I had a contradictory view with one friend regarding investment activity. His view on investment is you invest a certain amount of money in let's say a business in hope that business will go up in value and in some point you will sell your participation in that business and you will make a profit, this is know as " Capital Gain" . What my friend missed to say is that investment is not only capital gain, but also cashflow earnings. Being involved for several years in certain investment activities , I have gained some experience and I want to share with you from my experience. From the beginning you need to understand that I not make investment recommendations. So let's get started:

 1 CAPITAL GAIN

Is the simple and easy to understand form of investment. You invest X amount money in something, if the price of that asset goes up at one point you sell your asset. The difference between your initial investment and the price you will obtain is know as capital gain. You can obtain capital gain if you invest in many asset categories. I will try to enumerate the most important of them:

Own Business    

Is the most important type of investment you can make. Being a business owner can provide you huge opportunities, your are accountable for your own decision and so on. Startups are in general very risky to invest but in the same time have huge rewarding potential. Ventures Capital companies are looking to invest in startups with potential to scale up quick. They are looking investments that can provide 5 to 7 times return on investment. For that reason to invest your money in a startup is the best decision that you can make.

 Public Companies

Is perhaps the most easy way to invest. Public traded companies provide opportunities to average people to invest. You don't need huge amount of money to invest, with few hundred dollars you can open a brokerage account. Capital gain can be obtained by investing in Company X and selling when price goes up.

Real Estate Properties

Type of real estate properties are : houses, residential properties, commercial, office and logistic parks. The same principle will apply like the previous two. You buy a property a certain amount of money and you will sell when the price will goes up.

Physical Gold

Seen by many as "God Money" gold is doing very under uncertain periods of time like we live now.

2 Cashflow

Many people see investment as an activity to obtain gain, which is true but not 100 %. They forgot to mention as source of extra  income. It is nothing more happy for a person to obtain additional source of income by not doing any effort and work. People can choose to invest in different category of assets that can provide valuable source of income.

Startup

As I said above, startups can be the most rewarding type of investment that you can make. Let' say you help your friend to start his business by borrowing him money in exchange for equity in his business. By the end of each year you will share the profit by not doing any activity.

Dividend Stocks   

Is one of my favorite source of passive  income. Public trade companies usually pays dividends once or twice per year in Eurozone Area , in US quarterly . There are companies in the world that have impressive dividend record payments for more than 50 years. These business are large with strong competitive advantage, however you need to be aware that in this economic conditions of Covid-19 pandemy some companies will cut dividend payment. ECB (European Central Bank)  send a directive to all commercial banks in Euro Area to cut dividend payments for 2019 financial year.

Real Estate

Is widely used by many people, is an exceptional source of extra money. Let's say you own an apartment and you rent it to a person in exchange for monthly rent payment.

Amazon FBA

If you have a product and you are looking to sell it online, Amazon can be the right platform for you . The principle is simple you send your products to Amazon fulfilment center and the company will take care for your products and orders in exchange for weekly fees (storage, handling, shipping). This is an exceptional way to have extra source of income.


In conclusion the decision to invest or not is up to you. To keep your money in cash is not seen as wise move, however with all of us should be aware of the importance of cash in special on this economic conditions of pandemy. Cash can be the king !! Let's imagine you are a person who was laid off by government lock down to have extra cash can be extremely important can help you to pay (rent, bills, food, mortgages and so on). The same principles applies to business, cash for business is like to oxygen for people, making a sad analogy with what happen today with some people infected with Covid-19, without air people slowly dies, the same principle will apply for business.