Code completion is a widely used tool that removes the element of repeatedly typing the same identifiers when writing code. With the use of different learning and ranking algorithms a code completion system constructs a list of possible completions given the first few characters of the identifier being written. This post presents an approach to improve the accuracy of the ranked candidate lists using historical data of the program being written. Different features are explored and tested in combination with the Perceptron and Logistic Regression Gradient Descent learning algorithms to find what bares the highest significance when predicting the identifier being typed. The experiments aim to prove that classification algorithms modified for rank calculation based on historical data could potentially improve code-completion systems for scripting languages such as Python.