Posts

Showing posts with the label Pandas

Kullback–Leibler divergence (KLD) and NFT Economics

Image
Ok, so you've launched your cool NFT game, that you'd been working on it for years. The platform is ready, the tokens are minted, the users are hyped and coming in droves. Sustainable scaling the product is not easy - I mean just listen to Tony Robbins . And while the token economics have be drafted in the whitepaper, the users would have to actually behave the similarly to what you'd invisioned. For instance, suppose you have an RPG , where user acquire experience and level up. In order to level up, they need to earn in-game artifacts, which can also be bought in the marketplace (where you charge transaction fees - here comes your business model). After having some thought you have drafted the approximate path of users' level progress and even ran Monte Carlo simulation to get some sence of possible distribution. Having finalised all the statistical models and simulations, you've come to the following conclusion - an average user will upgrade the free ban...

Tweets Analysis with Python and NLP

Image
Introduction You should be already familiar with the concepts of NLP from our previous post , so today we'll see more useful case of analysis the tweets and classifying them into marketing and non-marketing tweets. We won't get into details of tweets retrieval, this can be done with various packages with Tweepy being the most popular one. Baseline For the purpose of the discussion we already have 2 sets of tweets separated into files and are uploaded into GitHub folder . First we download the datasets, add target column as 1 for marketing tweets and unite the datasets. Then we'll check the baseline classification results, without any pre-processing. We do this so later we could understand whether our changes improve the metrics. We'll be using Random Forest for classification, since it doesn't expect linear features or even features that interact linearly and it can handle very well high dimensional spaces as well as large number of training examples. Plu...

Natural Language Processing with Python

Image
Introduction Natural language processing, or NLP, is a process of analyzing the text and extracting insights from it. It is used everywhere, from search engines such as Google or Bing , to voice interfaces such as Siri or Cortana . The pipeline usually involves tokenization , replacing and correcting words, part-of-speech tagging , named-entity recognition and classification. In this article we'll be describing tokenization, by using a full example from Kaggle notebook . The full code can be found on GitHub repository . Installation For the purposes of NLP, we'll be using NLTK Python library, a leading platform to work with human language data. It provides easy-to-use interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning, wrappers for industrial-strength NLP libraries. Installing the package is easy using the Python p...

Python for Data Scientists - Pandas

Image
Introduction Having learnt NumPy and SciPy in previous articles, let's discuss our next package, called pandas. Pandas provides rich data structures and functions designed to make working with structured data fast, easy, and expressive. It is, as you will see, one of the critical ingredients enabling Python to be a powerful and productive data analysis environment. Pandas combines the high performance array-computing features of NumPy with the flexible data manipulation capabilities of spreadsheets and relational databases (such as SQL), mingling DataFrame - a two-dimensional tabular, column-oriented data structure with both row and column labels. It provides sophisticated indexing functionality to make it easy to reshape, slice and dice, perform aggregations, and select subsets of data. For users of the R language for statistical computing, the DataFrame name will be familiar, as the object was named after the similar R data.frame object. However the functionality...