This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://mlflow.org/docs/latest/tutorials-and-examples/tutorial.html | |
# The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality | |
# P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis. | |
# Modeling wine preferences by data mining from physicochemical properties. In Decision Support Systems, Elsevier, 47(4):547-553, 2009. | |
import os | |
import warnings | |
import sys | |
import pandas as pd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#All credits to https://youtu.be/34cqrIp5ANg, Customized and simplified it for my reference | |
import json | |
from fastapi import FastAPI, HTTPException | |
import os | |
app = FastAPI() | |
BOOKS_FILE = "books.json" | |
BOOK_DATABASE = ['The great gatsby','atomic habits','norwegien wood'] | |
if os.path.exists(BOOKS_FILE): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error #1 | |
Error - cannot import name '_validate_lengths' | |
Link - https://github.com/numpy/numpy/issues/12744 | |
Resolution - conda install -c conda-forge scikit-image | |
Error #2 | |
Disable Windows 10 HVCI Mode | |
https://docs.microsoft.com/en-us/windows/security/threat-protection/device-guard/enable-virtualization-based-protection-of-code-integrity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying Your First Docker Container | |
https://katacoda.com/courses/docker/deploying-first-container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://github.com/vlazovskiy/predicting-instacart-purchases/blob/master/logistic_regression_models.ipynb | |
#Rewrite Everything in TSQL | |
#Build Model | |
#Submit Report | |
#Save and Restore Data Frame | |
import pandas as pd | |
import numpy as np | |
from collections import OrderedDict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Versions check - Python | |
import sys | |
print("python environment " + str(sys.version_info)) | |
#OpenCV version | |
import cv2 | |
print("OpenCV version " + str(cv2.__version__)) | |
#Tensorflow version | |
import tensorflow as tf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Credits - https://github.com/hunkim/PyTorchZeroToAll/blob/master/05_linear_regression.py | |
import torch | |
from torch.autograd import Variable | |
x_data = Variable(torch.Tensor([[1.0],[2.0],[3.0]])) | |
y_data = Variable(torch.Tensor(([2.0],[4.0],[6.0]))) | |
class Model(torch.nn.Module): | |
def __init__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0.0 0.0 0.0 | |
0.1 0.1 0.1 | |
0.2 0.2 0.2 | |
9.0 9.0 9.0 | |
9.1 9.1 9.1 | |
9.2 9.2 9.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://lmcaraig.com/image-histograms-histograms-equalization-and-histograms-comparison/ | |
def rgbequalized(imagefilePath): | |
imageoriginal = cv2.imread(imagefilePath,1) | |
image = cv2.resize(imageoriginal, (24, 24), interpolation = cv2.INTER_AREA) | |
b,g,r = cv2.split(image) | |
b_data = cv2.equalizeHist(b) | |
bf_data = b_data.flatten() | |
bflatdata = bf_data.astype(np.float32) | |
bfeaturedata = (bflatdata - np.min(bflatdata)) / (np.max(bflatdata) - np.min(bflatdata)) * 2 - 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Quiz 2a | |
# | |
# | |
# Q1 | |
# The edit distance is the minimum number of character insertions and character deletions required to turn one string into another. Compute the edit distance between each pair of the strings he, she, his, and hers. Then, identify which of the following is a true statement about the number of pairs at a certain edit distance. | |
# | |
packages <- c('combinat', 'stringdist') |
NewerOlder