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
import pickle | |
import cleaning | |
from cleaning import Process | |
test = open('test_pickle.pkl', 'rb') | |
methods = pickle.load(test) | |
test.close() | |
print(methods.__dict__) | |
print(methods.encode_col('ZZ')) |
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
#cleaning.py | |
import pickle | |
import functools | |
import math | |
class Process: | |
def __init__(self, *args): | |
self.args = args |
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
# Enable tab completion | |
source ~/git-completion.bash | |
# colors! | |
green="\[\033[0;32m\]" | |
blue="\[\033[0;34m\]" | |
purple="\[\033[0;35m\]" | |
reset="\[\033[0m\]" | |
# Change command prompt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
HEROKU_APP_NAME=regpackage | |
HEROKU_APP_NAME=regpackage | |
COMMIT_ID=$(shell git rev-parse HEAD) | |
build-ml-api-heroku: | |
docker build --build-arg PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL} -t registry.heroku.com/$(HEROKU_APP_NAME)/web:$(COMMIT_ID) . | |
push-ml-api-heroku: | |
docker push registry.heroku.com/${HEROKU_APP_NAME}/web:$(COMMIT_ID) |
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
version: 2 | |
defaults: &defaults | |
docker: | |
- image: circleci/python:3.7.2 | |
working_directory: ~/project | |
prepare_venv: &prepare_venv | |
run: |
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
jupyter_notebooks* | |
*/env* | |
*/venv* | |
.circleci* | |
packages/regression_model | |
*.env | |
*.log | |
.git | |
.gitignore |
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
#!/usr/bin/env bash | |
export IS_DEBUG=${DEBUG:-false} | |
exec gunicorn -b :${PORT:-5000} --access-logfile - --error-logfile - run:application |
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
FROM python:3.6.4 | |
# Create the user that will run the app | |
RUN adduser --disabled-password --gecos '' ml-api-user | |
WORKDIR /opt/ml_api | |
ARG PIP_EXTRA_INDEX_URL | |
ENV FLASK_APP run.py |
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
from marshmallow import Schema, fields | |
from marshmallow import ValidationError | |
import typing as t | |
import json | |
class InvalidInputError(Exception): | |
"""Invalid model input.""" |