Skip to content

MayukhSobo/Awesome-Snippets

Repository files navigation

Awesome-Snippets 💓

Some awesome snippets for the Coding(Mostly Data science) community

Snippets with 🔥 are used by me a lot

Usage File Cautions
If you got bored with the boring confusion matrix in sklearn and want something really cool and beautiful for your model performance. 🔥 confusionMatrix.py Please don't use it for more than 15 class labels and keep the name of the class labels shorter so that it can be visuialised easily
Ever wanted a snippet that can perform different types of sent2vec using word2vec! Well, your wait is over here! sent2vec.py Please note that only average word2vec and tfidf weighted word2vec is supported. Also, you need to download the pertrainined word2vec model. Use the following link word2vec Model. You can download this using wget command from terminal
Once you train a tensorflow2 or keras model, if you want to see the loss vs epoch or accuracy vs epoch for both validation and training data, you can use this snippet. display_performance.py Keep in mind that this only works for classification problems where you have separate training and validation data. Moreover accuracy is a metric that you are actively tracking. May not work for some special kind of metric however can always be modified as the code is written in simple python.
This uses SOTA transformer models to get the text features. This is ideal for a lot of zero shot learning where we want to get BERT/GPT features of the text data. 🔥 🔥 transformerFeatures.py This is still half baked and may not support all the libraries and their versions.
This shows how one can use tesnsorflow dataset API for Image Classification taks tfdataImage.ipynb It would only work with tensorflow 2.3 or above
Well this is not much realted to data science but this code generates the test cases if you are interested in Competitive Programming. gene.py It may not work for all the types. Please raise a PR

About

Some awesome snippets for the data science community

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published