Skip to content

Instantly share code, notes, and snippets.

View zenUnicorn's full-sized avatar
💭
Hello, am a software developer, hook me up for a gig

Shittu olumide zenUnicorn

💭
Hello, am a software developer, hook me up for a gig
View GitHub Profile

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

# importing the required libarary
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_excel("online_retail_II.xlsx")
df.head()
#Bar chart visualisation
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.python.org/pypi/certifi
import os
import os.path
import ssl
import stat
import subprocess
@zenUnicorn
zenUnicorn / init.py
Last active November 25, 2022 01:02
import comet_ml
experiment = comet_ml.Experiment(
api_key="<Your API Key>",
project_name="<Your Project Name>"
)
import comet_ml
api = comet_ml.api.API()
api.get()
experiment = api.get("zenunicorn/exp-notebooks/example 004")
import pandas as pd
import numpy as np
import warnings
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import keras_tuner as kt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import keras_tuner as kt
image_generator = ImageDataGenerator(rescale=1/255, validation_split=0.2)
#Train & Validation Split
train_dataset = image_generator.flow_from_directory(batch_size=32,
directory='data_cleaned/Train',
shuffle=True,
target_size=(224, 224),
subset="training",
class_mode='categorical')
batch_1_img = train_dataset[0]
for i in range(0,32):
img = batch_1_img[0][i]
lab = batch_1_img[1][i]
plt.imshow(img)
plt.title(lab)
plt.axis('off')
plt.show()
@zenUnicorn
zenUnicorn / CNN.py
Last active January 10, 2023 12:33
model = keras.models.Sequential([
keras.layers.Conv2D(32, (3, 3), activation='relu', input_shape = [224, 224,3]),
keras.layers.MaxPooling2D(),
keras.layers.Conv2D(64, (2, 2), activation='relu'),
keras.layers.MaxPooling2D(),
keras.layers.Conv2D(64, (2, 2), activation='relu'),
keras.layers.Flatten(),
keras.layers.Dense(100, activation='relu'),
keras.layers.Dense(2, activation ='softmax')
])