Skip to content

Instantly share code, notes, and snippets.

View aloknayak29's full-sized avatar

Alok Nayak aloknayak29

View GitHub Profile
@aloknayak29
aloknayak29 / pandas_dataframe_table_with_image_and_text.py
Created June 6, 2025 14:35
This is a python script created by LLM to create an html template with image and a pandas dataframe based table. Without any dependencies like jinja
import pandas as pd
df = pd.DataFrame({
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35],
'City': ['Delhi', 'Mumbai', 'Bangalore']
})
html_template = """
<!DOCTYPE html>
@aloknayak29
aloknayak29 / ft_wiki_preproc.py
Created July 29, 2017 08:00 — forked from bittlingmayer/ft_wiki_preproc.py
fastText pre-trained vectors preprocessing
# See https://github.com/facebookresearch/fastText/blob/master/get-wikimedia.sh
#
# From https://github.com/facebookresearch/fastText/issues/161:
#
# We now have a script called 'get-wikimedia.sh', that you can use to download and
# process a recent wikipedia dump of any language. This script applies the preprocessing
# we used to create the published word vectors.
#
# The parameters we used to build the word vectors are the default skip-gram settings,
# except with a dimensionality of 300 as indicated on the top of the list of word
@aloknayak29
aloknayak29 / basic_prototyping.ipynb
Last active March 23, 2017 09:36
Usage of sklearn models like logistic regression, linear SVM, Randomforests,Multi layered perceptron (feed forward artificial neural network), truncated SVD. Bag of words text preprocessing using countvectorizer etc. Usage of scikit-learn pipelines with pretrained transformers. Voting based ensemble of different classifiers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aloknayak29
aloknayak29 / main_pipelines.py
Created April 13, 2015 10:19
gridsearchcv cross validation, pipelining mmodels, Extending models
import numpy as np
from sklearn import linear_model
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.cross_validation import train_test_split
import sklearn
import json
from sklearn.externals import joblib
from sklearn.pipeline import make_pipeline
from sklearn.grid_search import GridSearchCV
@aloknayak29
aloknayak29 / sentiment_analysis.ipynb
Created December 12, 2014 06:53
sentiment analysis of movie reviews using NLTK naive bayes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aloknayak29
aloknayak29 / sudoku_solver.py
Created July 15, 2012 20:30
sudoku solver solve incomplete valid sudoku matrix using recursive backtrack ,little clever(find valid numbers group once instead validating each [1-9] number) as it could solve hard sudoku puzzle without getting timeout on udacity's sever .(created for u
# CHALLENGE PROBLEM:
#
# Use your check_sudoku function as the basis for solve_sudoku(): a
# function that takes a partially-completed Sudoku grid and replaces
# each 0 cell with a number in the range 1..9 in such a way that the
# final grid is valid.
#
# There are many ways to cleverly solve a partially-completed Sudoku
# puzzle, but a brute-force recursive solution with backtracking is a
# perfectly good option. The solver should return None for broken