Skip to content

Instantly share code, notes, and snippets.

View Thanatoz-1's full-sized avatar

Tushar Dhyani Thanatoz-1

View GitHub Profile
@Thanatoz-1
Thanatoz-1 / style1.css
Created October 7, 2022 10:06
css style for homepage
@import url("https://unpkg.com/primer/build/build.css");.highlight{width:100%;overflow:auto;background:#ffffff}.highlight .c{color:#999988;font-style:italic}.highlight .err{color:#a61717;background-color:#e3d2d2}.highlight .k{font-weight:bold}.highlight .o{font-weight:bold}.highlight .cm{color:#999988;font-style:italic}.highlight .cp{color:#999999;font-weight:bold}.highlight .c1{color:#999988;font-style:italic}.highlight .cs{color:#999999;font-weight:bold;font-style:italic}.highlight .gd{color:#000000;background-color:#fdd}.highlight .gd .x{color:#000000;background-color:#faa}.highlight .ge{font-style:italic}.highlight .gr{color:#a00}.highlight .gh{color:#999}.highlight .gi{color:#000000;background-color:#dfd}.highlight .gi .x{color:#000000;background-color:#afa}.highlight .go{color:#888}.highlight .gp{color:#555}.highlight .gs{font-weight:bold}.highlight .gu{color:#aaa}.highlight .gt{color:#a00}.highlight .kc{font-weight:bold}.highlight .kd{font-weight:bold}.highlight .kp{font-weight:bold}.highlight .kr{font
@Thanatoz-1
Thanatoz-1 / WSL terminal schema
Created July 16, 2020 12:36
Contains the tweaked version of schema for WSL terminal
{
"$id": "https://github.com/microsoft/terminal/blob/master/doc/cascadia/profiles.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Microsoft's Windows Terminal Settings Profile Schema",
"definitions": {
"KeyChordSegment": {
"pattern": "^(?<modifier>(ctrl|alt|shift)(?:\\+(ctrl|alt|shift)(?<!\\2))?(?:\\+(ctrl|alt|shift)(?<!\\2|\\3))?\\+)?(?<key>[^\\s+]|backspace|tab|enter|esc|escape|space|pgup|pageup|pgdn|pagedown|end|home|left|up|right|down|insert|delete|(?<!shift.+)(?:numpad_?[0-9]|numpad_(?:period|decimal))|numpad_(?:multiply|plus|add|minus|subtract|divide)|f[1-9]|f1[0-9]|f2[0-4]|plus)$",
"type": "string",
"description": "The string should fit the format \"[ctrl+][alt+][shift+]<keyName>\", where each modifier is optional, separated by + symbols, and keyName is either one of the names listed in the table below, or any single key character. The string should be written in full lowercase.\nbackspace\tBACKSPACE key\ntab\tTAB key\nenter\tENTER key\nesc, e
@Thanatoz-1
Thanatoz-1 / How to blend models
Created June 18, 2020 19:15
Contains gist of how different models are blended to create an ensembled predictions. Please be careful with the approach as this could result in corrupt kernels at the time of private submission.
# Read all the weights/outputs
# Specify weights for all models (such that they equal to 1)
# Finally, tweak them to create a perfect blend
### Ref
### https://www.kaggle.com/muhakabartay/simple-public-blender-0-936
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) target
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa
@Thanatoz-1
Thanatoz-1 / perceptron_dataset.csv
Created May 18, 2020 21:20
Contains the data for building the perceptron training
0.78051 -0.063669 1
0.28774 0.29139 1
0.40714 0.17878 1
0.2923 0.4217 1
0.50922 0.35256 1
0.27785 0.10802 1
0.27527 0.33223 1
0.43999 0.31245 1
0.33557 0.42984 1
0.23448 0.24986 1
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA0HOsVMA7RPjHPbB2hWQ+KZscScyeMVUSXy9e+m7KJcXgJfG/A4w0iQr2rUUE
Hp0uy/RUky4TPN/uLuIGQZlooiqiQ3M4nd3KckS7vK7aiAt5gUL3y2jCSkI2WJyfN8jetLBwOV3j
5jlyOSN74wGDxtKhQ8iMRku5J9rgxrtIrHOW8xlsRPZVuMjlX446TkIjQpojb82bK2jY6id7tiS3
ZHsBZhz70b9URrp/GhuSIsufpbPS6U+zfeiDUmnVkrkxu3eR5xbApM0CS1IlIvKplGkNc4KzaE2m
82f7HL6KrRLJAXSXXGZ/BTFtiDZz3JnWJdaxCvjxjnFHY2CwRM+i1wIDAQABAoIBAQDNhO6o1Krb
EskmGmCQncfoL4URgguKKg0mCceD9E2cNl8MKjAhKE/3ufaB2ST5phGohuoH/op7H3FvieuPK9iM
4qn/BJASncTnKrtKib7uGRogBs3XIB9HJcb9UNZuIr7ouXi8JsT2jTb//Os9YpXxJmRXN1iOSkRw
dg3eAnLhioF1v4rET2JrWA87DY05gsymeS/uAjerptWS4KWLiI1pgxAE3nYowYbUFxv7jcs4AttY
P74SraFrGxGs18n+Wyo0B8takjlwRDuGR+psKdLAq7CoHJiGz1OlKKppAPTzlDsY5pdGdAU6BwC7
@Thanatoz-1
Thanatoz-1 / Fast.ai install script
Last active January 19, 2019 02:32 — forked from gilrosenthal/Fast.ai install script
Fast.ai Install on Google Colab
!pip install -q "fastai==0.7.0" Pillow==4.1.1 torchtext==0.2.3
!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())
# !apt update -q
!apt install -y libsm6 libxext6
from os import path
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'
@Thanatoz-1
Thanatoz-1 / script.py
Created January 11, 2019 18:04
Code for running tensorboard using colab
# !!! RUN THIS CELL ONLY ON GOOGLE COLAB !!!
! wget https://raw.githubusercontent.com/hse-aml/intro-to-dl/master/setup_google_colab.py -O setup_google_colab.py
import setup_google_colab
# run tensorboard in background
import os
os.system("tensorboard --logdir=./logs --host 0.0.0.0 --port 6006 &")
# expose port and show the link
setup_google_colab.expose_port_on_colab(6006)
@Thanatoz-1
Thanatoz-1 / create_test_db.py
Created December 28, 2018 22:13 — forked from sprin/create_test_db.py
A demo of creating a new database via SQL Alchemy. This module takes the form of a nosetest with three steps: - Set up the new database. - Create a table in the new database. - Teardown the new database.
"""
A demo of creating a new database via SQL Alchemy.
Under MIT License from sprin (https://gist.github.com/sprin/5846464/)
This module takes the form of a nosetest with three steps:
- Set up the new database.
- Create a table in the new database.
- Teardown the new database.
"""
@Thanatoz-1
Thanatoz-1 / Pipeline-guide.md
Created December 3, 2018 10:18 — forked from ecgill/Pipeline-guide.md
Quick tutorial on Sklearn's Pipeline constructor for machine learning

If You've Never Used Sklearn's Pipeline Constructor...You're Doing It Wrong

How To Use sklearn Pipelines, FeatureUnions, and GridSearchCV With Your Own Transformers

By Emily Gill and Amber Rivera

What's a Pipeline and Why Use One?

The Pipeline constructor from sklearn allows you to chain transformers and estimators together into a sequence that functions as one cohesive unit. For example, if your model involves feature selection, standardization, and then regression, those three steps, each as it's own class, could be encapsulated together via Pipeline.

Benefits: readability, reusability and easier experimentation.