Skip to content

Instantly share code, notes, and snippets.

@keitazoumana
keitazoumana / pandas_tips_and_tricks.csv
Created July 24, 2023 03:42
Pandas Tips and Tricks
Title Link Video
Pandas and Python Tips and Tricks for Data Science and Data Analysis https://towardsdatascience.com/pandas-and-python-tips-and-tricks-for-data-science-and-data-analysis-1b1e05b7d93a https://youtu.be/pvNvgW0USZU
Pandas & Python Tricks for Data Science & Data Analysis — Part 2 https://towardsdatascience.com/pandas-python-tricks-for-data-science-data-analysis-part-2-dc36460de90d https://youtu.be/UxMJoteb3v0
Pandas & Python Tricks for Data Science & Data Analysis — Part 3 https://towardsdatascience.com/pandas-python-tricks-for-data-science-data-analysis-part-3-462d0e952925 https://youtu.be/vW1YLKnMmQY
Pandas & Python Tricks for Data Science & Data Analysis — Part 4 https://towardsdatascience.com/pandas-python-tricks-for-data-science-data-analysis-part-4-67f61f69d62c
Pandas and Python Tricks for Data Science and Data Analysis — Part 5 https://towardsdatascience.com/pandas-python-tricks-for-data-science-data-analysis-part-5-8fc987cd82da https://youtu.be/ngTCMKs4070
@keitazoumana
keitazoumana / python.csv
Created July 24, 2023 03:36
Python Table
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 3 columns, instead of 2. in line 6.
Title, Link, Video
5 Python open-source tools to extract text and tabular data from PDF Files, https://towardsdatascience.com/5-python-open-source-tools-to-extract-text-and-tabular-data-from-pdf-files-9359cdde6b56,
When Should You Consider Using Datatable Instead of Pandas to Process Large Data?, https://towardsdatascience.com/when-should-you-consider-using-datatable-instead-of-pandas-to-process-large-data-29a4245f67c6,
Convert Any Type of Document to Text With Apache Tika Using Python API, https://medium.com/mlearning-ai/convert-any-type-of-document-to-text-with-apache-tika-using-python-api-ff306c467b3,
Collect Data From Reddit and Twitter— 600+ Million Monthly Active Users Platforms, https://medium.com/mlearning-ai/web-scraping-f854c9c30778,
Knockknock — Probably The Best Python Library For Notifications, https://towardsdatascience.com/knockknock-probably-the-best-python-library-for-notifications-136bdf788f8a,
Extract Text Written in Different Languages from Images with Python, https://towardsdatascien
@keitazoumana
keitazoumana / computer_vision.csv
Created July 24, 2023 03:32
Computer Vision Table
Title Link Video
Five Simple Image Data Augmentation Techniques to Mitigate Overfitting In Computer Vision https://towardsdatascience.com/simple-image-data-augmentation-technics-to-mitigate-overfitting-in-computer-vision-2a6966f51af4
YOLO Object Detection Explained https://www.datacamp.com/blog/yolo-object-detection-explained
How to Measure Model Performance in Computer Vision: A Comprehensive Guide https://encord.com/blog/measure-model-performance-computer-vision/
@keitazoumana
keitazoumana / nlp.csv
Created July 24, 2023 03:30
Natural Language Processing Table
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 3 columns, instead of 1. in line 6.
Title, Link, Video
Do You Want To Cluster Unlabeled Text Data? Try Out Topic Modeling, https://towardsdatascience.com/do-you-want-to-cluster-unlabeled-text-data-try-out-topic-modeling-235795ae7cb7,
Financial Text Classification With Deep Learning Using FinBERT, https://medium.com/mlearning-ai/financial-text-classification-with-deep-learning-using-finbert-51a73b393a08,
Named Entity Recognition with Spacy and the Mighty roBERTa, https://towardsdatascience.com/named-entity-recognition-with-spacy-and-the-mighty-roberta-97d879f981, https://youtu.be/OLwYBSE64m4
Scientific Documents Similarity Search With Deep Learning Using Transformers (SciBERT), https://towardsdatascience.com/scientific-documents-similarity-search-with-deep-learning-using-transformers-scibert-d47c4e501590,
Meet BERTopic— BERT’s Cousin For Advanced Topic Modeling, https://towardsdatascience.com/meet-bertopic-berts-cousin-for-advanced-topic-modeling-ea5bf0b7faa3, https://youtu.be/sZcGuYHWN_w
Unsupervised Multilingual Text Classification With Zero
@keitazoumana
keitazoumana / mlops.csv
Last active July 24, 2023 03:24
MLOps Table
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 3 columns, instead of 2. in line 5.
Title, Link, Video
Create An Awesome Streamlit App & Deploy it With Docker, https://towardsdatascience.com/create-an-awesome-streamlit-app-deploy-it-with-docker-a3d202a636e8,
Machine Learning models monitoring made easy with Mlfow - a concrete use case with Python API, https://medium.com/mlearning-ai/machine-learning-models-monitoring-made-easy-with-mlfow-a-concrete-use-case-with-python-api-334691936a7a,
When Your Machine Learning model teams up with Django REST API - A successful deployment into production, https://towardsdatascience.com/when-your-machine-learning-model-teams-up-with-django-rest-api-a-successful-deployment-into-2f720bd67ff1,
NLP MLops Project With DagsHub — Multi-Language Sentiment Classification Using Transformers — Part 1, https://towardsdatascience.com/nlp-mlops-project-with-dagshub-multi-language-sentiment-classification-using-transformers-fcbe6164b171,
NLP MLops Project With DagsHub — Deploy Your Streamlit App On AWS EC2 Instance — Part 2, https://towardsdatascience.com/nlp-mlops-pr
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 3 columns, instead of 2. in line 5.
Title, Link, Video
Transfer Learning: Understand the Big Picture & Make the Right Choices for Your Use Case, https://medium.com/geekculture/transfert-learning-understand-the-big-picture-make-the-right-choices-for-your-use-case-bb4abc3972e6,
Overview Of 4 Model Validation Approaches to Mitigate Overfitting Problem, https://towardsdatascience.com/overview-of-4-model-validation-approaches-to-mitigate-overfitting-problem-6d2eecdf8053,
eXplainable AI (XAI): LIME & SHAP Two Great Candidates to Help You Explain Your Machine Learning Models, https://towardsdatascience.com/explainable-ai-xai-lime-shap-two-great-candidates-to-help-you-explain-your-machine-learning-a95536a46c4e,
Using Gradio To Create Apps For Your Machine Learning Models, https://medium.com/geekculture/using-gradio-to-create-apps-for-your-machine-learning-models-569247f217ef, https://www.youtube.com/watch?v=OgQyZ4LApnY
How to Perform KMeans Clustering Using Python, https://towardsdatascience.com/how-to-perform-kmeans-clustering-using-python-7cc296ce
@keitazoumana
keitazoumana / datascience.csv
Last active July 24, 2023 03:05
Tables in Medium
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 3 columns, instead of 2. in line 5.
Title, Article Link, Video
A simple way to understand Association Rule from the Customer Basket Analysis Use Case, https://towardsdatascience.com/a-simple-way-to-understand-association-rule-from-the-customer-basket-analysis-use-case-c7bcd75bdec1, None
Different Metrics to Evaluate Binary Classification Models and Some Strategies to Choose the Right One, https://towardsdatascience.com/different-metrics-to-evaluate-binary-classification-models-and-some-strategies-to-choose-the-right-911ef72a107b, None
Introduction to Mito: Spreadsheet for Data Scientists That Also Generates Python Codes, https://towardsdatascience.com/introduction-to-mito-spreadsheet-for-data-scientists-that-also-generates-python-codes-642b4c2d7dfc, None
When R Meets SQL to Query Dataframes, https://towardsdatascience.com/when-r-meets-sql-to-query-data-frames-a94d9d92b0f2,
5 Essential Tools to Start a Career in Data Science and Data Analytics, https://towardsdatascience.com/5-essential-tools-to-start-a-career-in-data-science-and-data-analyti
"""
Individual imports
"""
from sklearn.metrics import precision_score, recall_score, f1_score
y_true = [0, 1, 2, 0, 1, 2]
y_pred = [0, 2, 1, 0, 0, 1]
print("Precision: ", precision_score(y_true, y_pred, average='macro'))
print("Recall: ", recall_score(y_true, y_pred, average='macro'))
import os
import faiss
import torch
import skimage
import requests
import numpy as np
import pandas as pd
from PIL import Image
from io import BytesIO
import IPython.display
%%bash
# Uncomment this if using for the first time. -qqq for ZERO-OUT
pip3 -qqq install transformers torch datasets
# The following two libraries avoid the UnidentifiedImageError
pip3 -qqq install gdcm
pip3 -qqq install pydicom
pip -qqq install faiss-gpu