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 pandas as pd | |
from scipy.stats import norm | |
import numpy as np | |
import matplotlib.pyplot as plt | |
np.random.seed(42) | |
pd.set_option('display.max_rows', None) | |
pd.set_option('display.max_columns', None) | |
pd.set_option('display.width', None) |
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 mimetypes | |
import pulumi_aws as aws | |
import pulumi | |
from pulumi import FileAsset | |
from pulumi_aws import s3 | |
def main(bucket_name: str, index_html_path: str, package_dist_path: str, aliases: list, certificate_arn: str, | |
domain_name: str, hosted_zone_id: str, ip_addresses: list): |
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 functools import reduce | |
import warnings | |
import jenkspy | |
import pandas as pd | |
warnings.filterwarnings('ignore') | |
pd.set_option('display.max_rows', None) | |
pd.set_option('display.max_columns', None) | |
pd.set_option('display.width', None) |
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 pandas as pd | |
import networkx as nx | |
from sklearn.base import BaseEstimator, TransformerMixin | |
class CentralityEncoder(BaseEstimator, TransformerMixin): | |
def __init__(self, node_column, edge_column): | |
self.mapping_dict = {} | |
self.node_column = node_column | |
self.edge_column = edge_column |
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 sklearn.base import ClassifierMixin, RegressorMixin | |
from sklearn.pipeline import Pipeline | |
from sklearn.preprocessing import FunctionTransformer | |
from helpers.wrangling import drop_features | |
from modeling.config import CATEGORICAL_FEATURES, FEATURES_TO_DROP | |
from modeling.embedding import EmbeddingsEncoder | |
def get_pipeline(model: RegressorMixin or ClassifierMixin) -> Pipeline: |
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 copy import deepcopy | |
import pandas as pd | |
from keras import models | |
from keras.layers import Dense, Embedding, Flatten | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.preprocessing import LabelEncoder, StandardScaler | |
class EmbeddingsEncoder(BaseEstimator, TransformerMixin): |
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 boto3 | |
import json | |
import string | |
import random | |
import warnings | |
from botocore.config import Config | |
from ds_helpers.aws import get_secrets_manager_secret | |
from ds_helpers.db import connect_to_mysql |
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 pandas as pd | |
import joblib | |
import os | |
from sklearn.model_selection import cross_val_score | |
from hyperopt import fmin, tpe, Trials, space_eval | |
def train_model(x_train, y_train, get_pipeline_function, model_uid, model, param_space, iterations, cv_strategy, | |
cv_scoring, static_param_space): |
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 mimetypes | |
import pulumi_aws as aws | |
import pulumi | |
from pulumi import FileAsset | |
from pulumi_aws import s3 | |
def main(bucket_name, index_html_path, aliases, certificate_arn, domain_name, hosted_zone_id, ip_address): | |
""" |
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 pulumi_aws as aws | |
def main(database_name, allocated_gb_storage, db_engine, db_engine_version, instance_class, root_password, | |
root_username, subnet_group_name, subnet_id_list, security_group_name, vpc_id, allowed_ip_list, | |
security_group_port): | |
""" | |
Creates an RDS instance and associated security group. | |
:param database_name: name of the database |
NewerOlder