Skip to content

Instantly share code, notes, and snippets.

View DhavalThkkar's full-sized avatar

Dhaval Thakkar DhavalThkkar

  • John Hancock Finance
  • Boston, USA
  • 02:26 (UTC +05:30)
View GitHub Profile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 18 18:08:03 2021
@author: thakkar
"""
# Tekore imports
import tekore as tk
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
import pandas as pd
import numpy as np
import sys
from datetime import datetime
# Slearn for easy label encoding, textblob for senitment reference
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import StratifiedKFold
from sklearn.cross_validation import train_test_split
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 7 11:52:37 2017
@author: thakkar_
"""
# Importing Libraries
import numpy as np
import pandas as pd
import seaborn as sns
@DhavalThkkar
DhavalThkkar / churn.py
Created May 13, 2017 07:12
AUC Score Gist
kfold = StratifiedKFold(n_splits=10, shuffle=True, random_state=1)
for train, test in kfold.split(X, y):
# Initial tests appear to indicate no overfitting, dropout layer unneccesary
ann = Sequential()
ann.add(Dense(500, activation='tanh', kernel_initializer='random_normal', input_shape=(X[train].shape[1],)))
ann.add(Dropout(rate=0.2))
ann.add(Dense(1, activation='sigmoid', kernel_initializer='random_normal'))
ann.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
ann.fit(X[train], y[train], batch_size=250, epochs=150, verbose=0)
@DhavalThkkar
DhavalThkkar / gui.py
Created January 26, 2017 10:17
new gui with ip fix
# coding: utf-8
# In[ ]:
# In[ ]:
@DhavalThkkar
DhavalThkkar / gui.py
Created January 26, 2017 10:03
new file
from tkinter import *
import tkinter
from tkinter import ttk
import socket
def calculate(*args):
try:
str = (domain_name.get())
ip_add = socket.gethostbyname(str)