This file contains 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
result_1 = weekly_demand_collection.aggregate([ | |
## stage 1 | |
{ | |
"$match" : { | |
"center_id" : { | |
"$eq" : 11 | |
} | |
} | |
}, | |
## stage 2 |
This file contains 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
weekly_demand_collection.find_one() |
This file contains 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
# importing required values | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
# read the train data | |
train_data = pd.read_csv('dataset/train_kOBLwZA.csv') | |
# check for the null values |
This file contains 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
# define function to add the image in the html file with the class name | |
def get_picture_html(path, tag): | |
image_html = """<p> {tag_name} </p> <picture> <img src= "../{path_name}" height="300" width="400"> </picture>""" | |
return image_html.format(tag_name=tag, path_name=path) | |
# define function to add the list element in the html file | |
def get_count_html(category, count): | |
count_html = """<li> {category_name} : {count_} </li>""" | |
return count_html.format(category_name = category, count_ = count) |
This file contains 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
# get directory function in get images file | |
def get_directory(url): | |
return "URL_" + str(url.replace("/","_")) |
This file contains 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
# importing the required libaries | |
from flask import Flask, render_template, request, redirect, url_for | |
from get_images import get_images, get_path, get_directory | |
from get_prediction import get_prediction | |
from generate_html import generate_html | |
from torchvision import models | |
import json | |
app = Flask(__name__) |
This file contains 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
# importing the required libraries | |
import json | |
import io | |
import glob | |
from PIL import Image | |
from torchvision import models | |
import torchvision.transforms as transforms | |
# Pass the parameter "pretrained" as "True" to use the pretrained weights: | |
model = models.densenet121(pretrained=True) |
This file contains 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
# get the summary of the numerical columns | |
my_data.select('Isball', 'Isboundary', 'Runs').describe().show() |
This file contains 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
# import the classification module | |
from pycaret import classification | |
# setup the environment | |
classification_setup = classification.setup(data= data_classification, target='Personal Loan') |
This file contains 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
# load model | |
dt_model = classification.load_model(model_name='decision_tree_1') |