Hey folks! I am feeling really proud to announce the completion of my very own book. After a lot of hard-work and sheer determination this became possible and “Intermediate Python” saw the light of day. It will receive updates over time :) Continue reading
Originally posted on alexhwoods:
A Markov Chain is a random process, where we assume the previous state(s) hold sufficient predictive power in predicting the next state. Unlike flipping a coin, these events are dependent. It’s easier to understand through an example.
Imagine the weather can only be rainy or sunny. That is, the state space is rainy or sunny. We can represent our Markov model as a transition matrix, with each row being a state, and each column being the probability it moves to another.
In other words, given today is sunny, there is a .9 probability that tomorrow will be sunny, and a .1 probability that tomorrow will be rainy.
One cool application of this is a language model, in which we predict the next word based on the current word(s). If we just predict based on the last word…
View original 507 more words
Hi guys. Recently my interview was published over at Mouse vs Python blog which is run by Mike. I am glad that I was able to become a part of Mike’s PyDev of the week series. This post is not going to be technical. I am going to use my time to clear up my mind through this post.
Originally posted on Wrong Side of Memphis:
This blog post by Dan Crosta is interesting. It talks about how is possible to optimise Python code for operations that get called multiple times avoiding the usage of Object Orientation and using Closures instead.
While the “closures” gets the highlight, the main idea is a little more general. Avoid repeating code that is not necessary for the operation.
The difference between the first proposed code, in OOP way
and the last one
The main differences are that both the config dictionary and the methods (which are also implemented as a dictionary) are not accessed. We create a direct reference to the value (categories and mode) instead of making the Python interpreter search on the self methods over and over.
This generates a significant increase in performance, as described on the post (around 20%).
But why stop there? There is another clear win in terms of access, assuming that the…
View original 310 more words
Hi there guys! If you have been following my recent posts then you might know that I have started a newsletter. This newsletter covers everything related to Python which I come across every week. Continue reading