Skip to content

Instantly share code, notes, and snippets.

View habedi's full-sized avatar
🚀

Hassan Abedi habedi

🚀
View GitHub Profile
@habedi
habedi / download_kaggle_dataset.sh
Created April 3, 2024 05:49
A Bash script to download Kaggle datasets using the Kaggle API
#!/bin/bash
# Download a dataset or competition data from Kaggle using the Kaggle API
# Usage: download_kaggle_dataset.sh <type> <dataset-name> <output_dir>
# Arguments:
# type: The type of the Kaggle data to download. Either '-d' or 'dataset' for dataset, or '-c' or 'competition' for competition.
# dataset-name: The name of the dataset or competition on Kaggle. For datasets, it should be in the format 'username/dataset-name'.
# output_dir: The directory where the data will be downloaded and extracted.
# Examples:
@habedi
habedi / install_useful_cli_tools.sh
Last active April 2, 2024 05:53
A Bash script to install a collection of (very) useful CLI tools and programs
#!/bin/bash
# List of the packages to be installed and their descriptions
packages=(
"exa:A modern replacement for 'ls'"
"duf:Disk Usage/Free Utility"
"fzf:A general-purpose command-line fuzzy finder"
"bpytop:Resource monitor that shows usage and stats for processor, memory, disks, network and processes"
"htop:Interactive process viewer"
"nano:Easy-to-use text editor"
@habedi
habedi / my_template_colab_notebook_v1.ipynb
Last active April 11, 2024 07:44
A template notebook to be used in the Google Colab environment
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habedi
habedi / init_database.py
Created February 18, 2024 05:02
A Python script to calatogue the tables in the eICU Collaborative Research Database (https://eicu-crd.mit.edu/) in DuckDB
import argparse
from pathlib import Path
import duckdb
# Create the parser
parser = argparse.ArgumentParser('`init_database.py` creates a DuckDB database '
'from the eICU dataset.')
# Add the arguments
@habedi
habedi / .editorconfig
Last active March 20, 2024 02:39
My (template) EditorConfig file
# EditorConfig is awesome: https://EditorConfig.org
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
-- Description: This file contains the SQL statements to create the tables to store two geosocial datasets into a MySQL/MariaDB database
-- The datasets are available at http://snap.stanford.edu/data/loc-gowalla.html
-- and http://snap.stanford.edu/data/loc-brightkite.html
-- Create database and tables to store the Gowalla and Brightkite datasets
DROP DATABASE IF EXISTS geosocial_db; -- Drop the database if it exists (comment this line if you want to keep the old database
CREATE DATABASE geosocial_db; -- Create the geosocial_db database (comment this line if you want to keep the old database
-- Switch the geosocial_db database
USE geosocial_db;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// dataset = ds
// Deleting all the nodes
MATCH (n)
DETACH DELETE n;
// Deleteing all the edges
MATCH ()-[r]->()
DELETE r;
@habedi
habedi / multi_output_regression_keras.py
Created October 15, 2022 06:02
Example Python code for performing multi-output regression with Keras and TensorFlow
# Download the 'train_embeddings.pkl' from https://files.fm/f/76h5d4229
# Run the code in the folder where 'train_embeddings.pkl' is located.
import io
import compress_pickle as pickle
import numpy as np
import tensorflow as tf
from keras import Sequential
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, EarlyStopping