Model selection refers to choose the best statistical machine learning model for a particular problem. For this task we need to compare the relative performance between models. Therefore the loss function and the metric that represent it, becomes fundamental for selecting the right and non-overfitted model. We can state a machine learning supervised problem with […]

## Evaluate Model Performance – Loss Function

The predictions that the model returns will be compared with the real observation of the variable to obtain a measure of model performance. In order to evaluate the model performance, both classification and regression problems need to define a function called loss function that will compute the error of the model. This loss function is […]

## Train-Test Datasets in Machine Learning

Once we have cleaned the data and have selected the features from the data for building the model, the next step is to generate the train and test dataset. We will divide our data into two different data sets, namely training and testing datasets. The model will be built using the training set and then […]

## Feature Selection in Machine Learning

Feature Selection is one of the core concepts in machine learning and has a high impact on the performance of the model. Irrelevant or partially irrelevant features can negatively impact the model performance. In this process those features which contribute most to the prediction variable are selected. In order to get an idea about which […]

## Data Preprocessing in Data Science and Machine Learning

Data preprocessing is where data scientist spent most of their time. These tasks involve selecting the appropriate features as well as clean and prepare them to become the inputs or independent variables in a machine learning model. Model performance is strictly related with the selection and cleaning of the features. Below we describe common tasks […]

## What is Machine Learning?

Machine Learning is the field which applies statistical analysis and computer science for employing algorithms that learn how to perform tasks such as prediction or classification of a target variable as well as grouping data. These algorithms learn from data and are widely diverse as they range from traditional statistical models based on inference to […]

## Machine Learning with Python

This tutorial provides a conceptual framework and practical insights to work in the Machine Learning field using python programming language. The content of the tutorial combines theoretical concepts with programming examples about how to use these algorithms through the Scikit learn library from Python. All the examples are related to the application of machine learning […]

## Portfolio Optimisation in R

For this tutorial, both minimum-variance and mean-variance will be taught. The PortfolioAnalytics package will be used extensively throughout as it allows for a simple workflow for portfolio optimisations. The first part of the code is to define that a portfolio optimisation problem exists. The only variable that needs to be defined is the names of […]

## Modern Portfolio Theory

This is a brief recap of Modern Portfolio Theory (MPT) before delving into practical applications of it. While there are many aspects of MPT, the focus will be on its application for portfolio optimisation. The origin of MPT came from a paper written by Harry Markowitz in 1952 to create an optimal portfolio. From thereon, […]

## Calculating Stock Returns and Portfolio Returns in R

To calculate the returns of AAPL & GOOG over the time period, you can use the Return.calculate function. This will then calculate the daily returns of AAPL and GOOG over the time period. The first day, as there is nothing to divide it by, will be NA. It generally makes sense to use this code […]