Photo by Igor Shabalin

In recent times, the field of machine learning has largely shifted to neural networks. While a neural network (a deep learning model) typically requires more computational processing power than a regular machine learning model, it often yields more accurate results. A typical neural network requires lots of training — stepping through multiple epochs — to get the learning processes correct. In this context, an epoch of training is considered a single presentation of training samples to the network. During each epoch, the model is updated accordingly, with the ultimate goal of improving accuracy.

In my previous post Stock Price Analysis…

Photo by Igor Shabalin

SQL is the primary tool for accessing and manipulating data in many databases. It is designed to work with tabular data stored in a database’s containers referred to as tables, allowing you to efficiently access, group, merge and analyze data from different tables. Pandas library, in turn, is designed to efficiently perform all those operations on datasets loaded into a Python script. So, pandas DataFrame is a two-dimensional data structure that is similar to SQL table.

This article provides both pandas and MySQL examples, illustrating how you can use these tools to combine datasets, as well as how to group…

Vintage radio. Photo by Igor Shabalin from

Being a robust method of data analysis that enables building of applications that can learn from data, machine learning is used in many fields, including predictive analysis, learning associations, anomaly detection, natural language processing (NLP), and image analysis. This article illustrates an example of how you can create a machine learning model for stock price analysis in Python.

Preparing Your Working Environment

For the purpose of the article example, you’ll need to obtain historical price data of a stock, as well as the figures of a stock market index, such as S&P500 index. This data can be obtained via APIs that have Python wrappers…

Getting Started

Learn to use word vectors to calculate the semantic similarity of texts programmatically

Photo by Nika Charakova

In a nutshell, word vectors are nothing but the series of real numbers that represent the meanings of natural language words. This technology is an important enabler of useful NLP capabilities that allow machines to “understand” human language. This article discusses how you can use word vectors to programmatically calculate the semantic similarity of texts, which can be useful if you need, for example, to classify those texts based on the topics they cover. …

Photo by Igor Shabalin

If you search for ways to improve your stock investment skills, you’ll definitely find ‘do some research’ among other things.

The decision on whether to buy, sell, or hold the stock is often taken based on emotions, which is definitely not the best strategy. To make balanced choices, you need to raise your logic and decrease your emotions by weighing up the pros and cons of any possible decision. The ability to make informed decisions can help you get ahead of your competition. …

Photo by Dmitry Starinov

It’s quite common nowadays to employ computer technologies to predict stock returns. Thus, many stock prediction algorithms rely on machine learning technology to search patterns and insights in stock data. Before you can do that however, you first need to obtain a data set with necessary stock data and then load it into a data structure in your program. This article covers how you can accomplish those first steps required to get started with stock data analysis in Python.

Getting Stock Data from Yahoo Finance

Where can I get data for analysis? This is perhaps the first question you may have after you decide to perform…

Photo by Igor Shabalin

Sentiment analysis is a task of text classification. In particular, it is about determining whether a piece of writing is positive, negative, or neutral. Having a set of labeled sentences accordingly, you may train a machine learning model that can be then used to make predictions on new sentences. This article illustrates that the process of training such a model can be implemented with just a few lines of code in a Python script that employs the sklearn library.

Loading the Data from a Data Set

In the article example, we’ll take advantage of the Sentiment Labelled Sentences Data Set available from the UCI Machine Learning Repository…

Photo by Igor Shabalin

The process of finding necessary information in the internet manually can be quite time consuming. This article discusses how you might tune your own channel in a messenger to automatically get latest information on the topics of your interest. The idea is the following: you create a bot that will collect information for your channel and then connect this bot to the channel. You need to make the bot available for everyone, so that the results of bot users’ requests come to your channel.

This approach allows you to discover the latest trends, since you will receive the information in…

Photo by Igor Shabalin

Nowadays, the internet has become the main source of information for most of us. When we need to learn about something or master something, we typically go online, using a web search engine like Google to obtain necessary information. Reviewing the retrieved results however, may take considerable time, requiring you to look into each link to see whether the information it contains really suits you. You can significantly shorten your research time when you know exactly what you want to find and can narrow down your search accordingly.

The problem is, though, that sometimes it’s too hard to explain all…

Photo by Ivan Brigida

Everything occurs somewhere. That is why the spatial attributes representing the features of an object can be not less important than its nonspatial attributes when performing data analysis in which that object is involved. As a very simple example, consider taxi ordering via an application. When you order a taxi, you might want to know not only some basic information about the car and the driver assigned to your order but also track their current location on a map while they are heading to you.

Python has a robust ecosystem of pre-existing libraries that can be leveraged in spatial analysis…

Yuli Vasiliev

is the author of Natural Language Processing with Python and spaCy (2020, No Starch Press,

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store