Skip to main content

Posts

Showing posts from April, 2020

Statsmodels errors,mistakes and solutions

Introduction: Statsmodels is not that famous a library as scikit-learn (sklearn) is. But often a time for statistical analysis, you will want to use statsmodel packages. Also, it is one of the closest resemblance between R packages and python packages. I have been using it on and off for the last year and I find it difficult to remember all the errors, common mistakes, and their necessary solutions. This post is meant to serve as a small directory of statsmodels related errors and mistakes and their possible solutions. model does not have attribute summary: Let's say you are training some model with the following sort of code: model = sm.Logit(Y,X) model.fit() print(model.summary()) And then this error arises, saying that model does not have an attribute summary. Also if you try model.predict(), you will get the error somewhat like 'model do not have the predict method'. The reason being that, once in statsmodels you fit the model, the trained model with all th...

Pandas errors and their solutions

Problem 1: Grouper for is not 1-dimensional I was writing a nice little script in pandas where I wanted to group some data using some identifier columns. And then suddenly the error popped in the console was: Grouper for Id is not 1-dimensional. And I started investigating for it. Solution: This error comes if there are multiple copies of the same grouper column. In that case, you will find this error. grouper for bar is not 1-dimensional: source: stackoverflow Problem 2: unhashable type: numpy.ndarray This is a more generalized type of error. There are multiple instances where this error occurs; including when you try to treat a numpy ndarray object as a value or a string type object and so on. I encountered this problem when I tried to group a bunch of values in which a column contained arrays as entries. If your pandas dataframe contains array or np.ndarray as values of single cells, then this dataframe can not be further used for other different actions even like drop_du...

Deep Learning by Ian GoodFellow, Yoshua Bengio and Aaron courville Review

History: I have been reading deep learning topics from a number of resources like machine learning mastery by Jason Brawlee, Analyticsvidhya, and other blog resources. But the problem has stayed, the problem of inconsistency in the knowledge. Therefore, I have decided to now sit down, and go through a deep learning book thoroughly. And what better name for deep learning other than Ian Goodfellow! So I have found this book named Deep Learning by Ian Goodfellow. Introduction: Plan for this post is reviewing and rewriting the topics from the book, in simpler language and for sharing the pieces of knowledge with my readers. I will update this post continuously as I proceed with the reading also. So ideally this post is broadly about basic to advanced deep learning material discussion. Sponsored Ads Learn deep learning in python with Udemy   Different parts of the book and purpose of them: This book has three parts,which talks about (1) applied mathematics and machine learni...

A comprehensive article on Stemming

Select Language Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Gujarati Marathi Nepali Punjabi Tamil Telugu Introduction: During natural language processing, every day, we face one challenge which is cleaning a text properly. For cleaning text, we often use two methods to modify the texts, which are stemming and lemmatization. In this post, we will analyze about stemming and lemmatization in details. What is stemming and lemmatization? For grammatical reasons, we tend to use words that are the same up ...