Skip to content

Instantly share code, notes, and snippets.

View shravankumar147's full-sized avatar
🎯
Focusing

Shravankumar shravankumar147

🎯
Focusing
View GitHub Profile
@shravankumar147
shravankumar147 / word_cloud_wine_data.ipynb
Created September 23, 2020 11:05
word_cloud_wine_data.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from PIL import Image, ImageDraw, ImageFont
import sys
ShowText = sys.argv[1]
font = ImageFont.truetype('arialbd.ttf', 15) #load the font
size = font.getsize(ShowText) #calc the size of text in pixels
image = Image.new('1', size, 1) #create a b/w image
draw = ImageDraw.Draw(image)
draw.text((0, 0), ShowText, font=font) #render the text to the bitmap
@shravankumar147
shravankumar147 / Find null count for all columns in pysark
Created February 17, 2020 01:04
This is an useful function helps in feature selection process of your ML workflow.
from pyspark.sql.functions import col
from pyspark.sql.functions import sum as spark_sum
def count_null(col_name):
return spark_sum(col(col_name).isNull().cast('integer')).alias(col_name)
# Build up a list of column expressions, one per column.
@shravankumar147
shravankumar147 / gradient-descent-intutive-understanding.ipynb
Created August 7, 2019 20:09
Gradient Descent Intutive understanding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / twitter-data-analysis.ipynb
Created July 17, 2019 20:30
Twitter Data Analysis.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
http://nadbordrozd.github.io/blog/2016/05/20/text-classification-with-word2vec/
https://blog.keras.io/using-pre-trained-word-embeddings-in-a-keras-model.html
https://stackoverflow.com/questions/31321209/doc2vec-how-to-get-document-vectors
http://linanqiu.github.io/2015/10/07/word2vec-sentiment/
https://rare-technologies.com/doc2vec-tutorial/
https://radimrehurek.com/gensim/models/doc2vec.html#gensim.models.doc2vec.TaggedDocument
https://www.kaggle.com/tj2552/sentiment-classification-in-5-classes-doc2vec
https://github.com/ibrahimsharaf/Doc2vec
http://nadbordrozd.github.io/blog/2016/05/20/text-classification-with-word2vec/
https://blog.keras.io/using-pre-trained-word-embeddings-in-a-keras-model.html
https://stackoverflow.com/questions/31321209/doc2vec-how-to-get-document-vectors
http://linanqiu.github.io/2015/10/07/word2vec-sentiment/
@shravankumar147
shravankumar147 / mnist_estimator.py
Created July 3, 2018 18:38 — forked from peterroelants/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output
@shravankumar147
shravankumar147 / build_face_dataset.py
Created June 28, 2018 03:32 — forked from machinelearning147/build_face_dataset.py
build_face_dataset using webcam
# USAGE
# python build_face_dataset.py --cascade haarcascade_frontalface_default.xml --output dataset/adrian
# import the necessary packages
from imutils.video import VideoStream
import argparse
import imutils
import time
import cv2
import os
@shravankumar147
shravankumar147 / file_download_os.py
Created March 20, 2018 18:31
File download using different methods
import os
cmd = "wget -c --progress=bar https://docs.microsoft.com/en-us/azure/cognitive-services/face/images/landmarks.1.jpg"
os.system(cmd)