This example employs several unsupervised learning techniques in
scikit-learn to extract the stock market structure from variations in historical close prices. The quantity that we use is the daily variation in close prices because prices that are linked tend to cofluctuate during a day.
For this project, we use several Python-based scientific computing technologies listed below.
import numpy as np
import pandas as pdimport pymc3 as pm
import theano as th
import seaborn as snsimport matplotlib.cm as cm
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollectionfrom…
This article covers regression analysis, which is fundamental to many applications of machine learning and throughout scientific disciplines. We will walk through some of the concepts and then dig into some regression examples using financial data from AlphaWave Data.
import numpy as np
import pandas as pd
from scipy import stats
import plotly.express as px
import plotly.graph_objects as go
from datetime import datetime, timedelta
from sklearn.linear_model import LinearRegression
In the context…
This article aims to introduce users to basic ML concepts and lay the foundation for future learning and exploration of ML. We will discuss common ML terminology and then cover three Python packages that are used in ML. The article concludes with additional resources for self-study.
Jargon is one of the first obstacles for beginners in ML. This section explains some of the most common terms you need to be familiar with.
Statistical approaches and ML techniques both analyze observations to reveal some underlying process; however, they diverge in their assumptions, terminology, and techniques. Statistical approaches rely on foundational assumptions…
Docs.python.org — Packages
Modules are simply Python files (.py) that contain Python code. This code can define functions, classes, variables, etc.
Modules allow us to organize our code by grouping related functionalities, which makes it easier to use and understand. Writing code into smaller, more manageable pieces will help you 1) debug easier, 2) create reusable code and 3) make the code more understandable to the end-user.
We can use the…
A class is a user-defined blueprint or prototype from which objects are created.
Classes provide a means of bundling data and functionality together. Creating a new class creates a new type of object, allowing new instances of that type to be made. Each class instance can have attributes attached to it for maintaining its state. Class instances can also have methods (defined by its class) for modifying its state.
To understand the need for creating a class, let’s consider an example. Let’s say you wanted to track the number of dogs which may have different attributes like breed and age…
Docs.python.org — Reading and Writing Files
I/O, or input/output, is communication between a computer and the outside world.
Inputs are signals received by the computer. The computer can get inputs from hardware like a keyboard and mouse or from other computers via the internet. Outputs are signals sent by the computer. Your monitor is probably the most obvious output device. …
A function is a block of organized, reusable code that is used to perform a single, related action.
Functions provide better modularity for your application and a high degree of code reusing.
Python gives you many built-in functions like print(), etc. but you can also create your own functions. These functions are called user-defined functions.
You can define functions to provide the required…
In the real world, you often need to repeat something over and over. It can be repetitive. When programming, though, if you need to do something 100 times, you certainly don’t need to write it out in 100 identical lines of code. In Python, loops allow you to iterate over a sequence, whether that’s a list, tuple, string, or dictionary.
There is a…
When you write code, you are giving instructions to the computer. When you are completing a task in the real world, however, you don’t just step through a sequence of instructions blindly. Depending on what else is going on, you will want to adapt your actions. The Python conditional allows you to encode these instructions so that the computer can dynamically adapt…
Python operators are symbols that perform an operation on one or more operands. An operand is a variable or a value on which we perform the operation.
Operators can manipulate individual items and return a result. Operators manipulate individual items by conducting mathematical operations and/or returning a Boolean value (True or False).
Mathematical operators are basic arithmetic symbols used to perform addition, subtraction, multiplication, and more.
Hugh co-founded AlphaWave Data in 2020 and is responsible for risk, attribution, portfolio construction, and investment solutions.