Skip to content

Instantly share code, notes, and snippets.

View vikramsoni2's full-sized avatar

Vikram vikramsoni2

View GitHub Profile
@vikramsoni2
vikramsoni2 / zip_directory.py
Created September 8, 2021 09:34
zip entire directory in python
from zipfile import ZipFile
import os
from os.path import basename
def zip_dir(dirname, zipfilename):
with ZipFile(zipfilename, 'w') as zipObj:
# Iterate over all the files in directory
for folderName, subfolders, filenames in os.walk(dirname):
for filename in filenames:
#create complete filepath of file in directory
@vikramsoni2
vikramsoni2 / tensorflow_plot_graphs.py
Created November 22, 2021 00:58
Tensorflow plot history using matplotlib
import matplotlib.pyplot as plt
def plot_graphs(history, string):
plt.plot(history.history[string])
plt.plot(history.history['val_'+string])
plt.xlabel("Epochs")
plt.ylabel(string)
plt.legend([string, 'val_'+string])
plt.show()
@vikramsoni2
vikramsoni2 / binary_confusion_matrix.py
Created February 23, 2022 02:07
bokeh binary confusion matrix
from sklearn.metrics import confusion_matrix, classification_report, precision_score, recall_score, auc
from bokeh.transform import dodge
from bokeh.plotting import figure, ColumnDataSource, output_notebook, show
output_notebook()
def plot_confustion_matrix(y_true, y_pred, cutoff=0.5, normed=False, classes = ["Negative", "Positive"], colors = ['#fcb471', '#fce3cc', '#ccdaea', '#76a0c9']):
@vikramsoni2
vikramsoni2 / keras_ctc_layer.py
Last active March 2, 2022 15:19
ctc loss layer keras
# https://keras.io/examples/vision/captcha_ocr/
class CTCLayer(layers.Layer):
def __init__(self, name=None):
super().__init__(name=name)
self.loss_fn = keras.backend.ctc_batch_cost
def call(self, y_true, y_pred):
# Compute the training-time loss value and add it
# to the layer using `self.add_loss()`.
@vikramsoni2
vikramsoni2 / temperatures.csv
Last active March 6, 2022 03:22
temperatures
m b actual (23*m+b) error
1.0 20 73 43.0 900.0
1.11 20 73 45.56 753.2
1.22 20 73 48.11 619.46
1.33 20 73 50.67 498.78
1.44 20 73 53.22 391.16
1.56 20 73 55.78 296.6
1.67 20 73 58.33 215.11
1.78 20 73 60.89 146.68
1.89 20 73 63.44 91.31
@vikramsoni2
vikramsoni2 / resume.json
Last active May 15, 2025 13:15
JSONResume
{
"basics": {
"name": "Vikram Soni",
"label": "Associate Director - AI & Machine Learning | GenAI Platform Architect",
"picture": "https://avatars.githubusercontent.com/u/7820298?v=4",
"email": "[email protected]",
"phone": "+34 616-886-127",
"website": "http://vsoni.com",
"summary": "Technology leader with proven expertise in designing enterprise-scale AI solutions that address complex business challenges and deliver measurable outcomes. Established Baxter International's GenAI platform from concept to enterprise-wide implementation, now processing over 1 million conversations, while maintaining a focus on responsible AI practices. Bridging technical innovation with business strategy to identify opportunities where AI can solve complex challenges, guiding organizations through technological transformation with pragmatic approaches that balance cutting-edge capabilities with real-world requirements. Experience spanning classical machine learning algorithms and generative AI
@vikramsoni2
vikramsoni2 / app.py
Last active December 16, 2022 16:31
streamline app
import streamlit as st
import requests, re
from bs4 import BeautifulSoup
import urllib.request
URL = st.text_input('URL', '')
download = st.button('DOWNLOAD')
@vikramsoni2
vikramsoni2 / fml.md
Last active April 10, 2023 19:58
failed machine learning

Failed Machine Learning

High-profile real-world examples of failed machine learning projects

Classical Machine Learning

Title Description
Amazon AI Recruitment System AI-powered automated recruitment system cancelled after evidence of discrimination against female candidates
Genderify - Gender identification tool AI-powered tool designed to identify gender based on fields like name and email address was shut down due to built-in biases and inaccuracies
@vikramsoni2
vikramsoni2 / README.md
Last active April 22, 2023 01:05
Add CSV data into SS from google drive

Link data stored in your Google Drive as CSV file into Squarespace.

You need to add the script provide in this gist to your Squarespace site using Code-injectin option and add the cde to the footer section.

Configurable options : IMPORTANT

targetNode:

This is a list element ( <ul> element in HTML) that you need to populate

@vikramsoni2
vikramsoni2 / script.html
Last active April 26, 2023 13:55
quantity selector SS
<script>
// select the quantity input element
el = document.querySelector('.product-quantity-input input')
// create two elements to increase and decrease
prev = document.createElement('div')
prev.id = 'btn-prev'
prev.innerHTML = '-'
next = document.createElement('div')