We have already seen how the k-Nearest Neighbors algorithm can be used to solve classification problems in R – the example used was the winery classification example from the UCI Machine Learning Repository. Here, let us see how kNN can […]
Continue reading »Tag: python
How To Create a Twitter App and API Interface Via Python
This tutorial illustrates how to use a Python API to connect to a Twitter account using the Twitter library. Specifically, this API allows a user to extract high quantities of data pertaining to a specific Twitter account, as well as […]
Continue reading »psycopg2: Connect Python to PostgreSQL Database – Part II
In a previous tutorial, we looked at how to create a simple PostgreSQL database of temperature across different world cities. The PostgreSQL database was created through a Linux terminal, and the same was then connected to R to import data/commit […]
Continue reading »Poisson and Cumulative Binomial Probabilities
A Poisson Distribution is a probability distribution which calculates the probability of a set of independent occurrences within a fixed time or space. e.g. Let us suppose that a prestigious college receives 1000 applications in a particular time interval. On […]
Continue reading »Python: Implementing a K-Means Algorithm With sklearn
The below is an example of how sklearn in Python can be used to develop a k-means clustering algorithm. The purpose of k-means clustering is to be able to partition observations in a dataset into a specific number of clusters […]
Continue reading »Machine Learning and Statistics: Recommended Texts
For learning the latest machine learning and statistics techniques, I’ve found certain guides to be much more useful than others. The two main languages that I currently rely on are R and Python. I’ve found that R comes out on […]
Continue reading »Implement an ARIMA model using statsmodels (Python)
In a previous tutorial, I elaborated on how an ARIMA model can be implemented using R. The model was fitted on a stock price dataset, with a (0,1,0) configuration being used for ARIMA. Here, I detail how to implement an […]
Continue reading »MySQLdb: Connect Python and mySQL Databases Together
In a previous tutorial, we set up a financial database using a range of mySQL queries, and used such queries to create separate tables and discriminate among data in those tables. However, there are many occasions when a user needs […]
Continue reading »Linear regression in Python: Use of numpy, scipy, and statsmodels
The numpy, scipy, and statsmodels libraries are frequently used when it comes to generating regression output. While these libraries are frequently used in regression analysis, it is often the case that a user might choose different libraries depending on the […]
Continue reading »Normal Distributions, Monte Carlo Simulations and Random Walks
A key concept in dealing with statistical data is the law of large numbers; meaning that the more observations we have across any particular dataset, the more that the data will resemble a normal distribution where the majority of results […]
Continue reading »