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
from typing import List, Dict, Tuple | |
x: int = 10 | |
y: float = 0.8 | |
string: str = 'I am a string' | |
hash_map: Dict[str, int] = {} | |
List1: List[int] = [] | |
my_tuple: Tuple[str, int] = () | |
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 numpy as np | |
import pandas as pd | |
from sklearn.datasets import make_blobs | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.pipeline import Pipeline | |
from sklearn.linear_model import LogisticRegression | |
class CustomImputer(BaseEstimator, TransformerMixin): |
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 numpy as np | |
import pandas as pd | |
from typing import Dict, List | |
from sklearn.datasets import make_blobs | |
from sklearn.base import BaseEstimator, TransformerMixin | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.pipeline import Pipeline | |
from sklearn.linear_model import LogisticRegression | |
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
def _e_step(self, X, pi, mu, sigma): | |
"""Performs E-step on GMM model | |
Parameters: | |
------------ | |
X: (N x d), data points, m: no of features | |
pi: (C), weights of mixture components | |
mu: (C x d), mixture component means | |
sigma: (C x d x d), mixture component covariance matrices |
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
from apache_beam.options.pipeline_options import PipelineOptions | |
from google.cloud import pubsub_v1 | |
from google.cloud import bigquery | |
import apache_beam as beam | |
import logging | |
import argparse | |
import sys | |
import re | |
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 mysql.connector | |
from mysql.connector import Error | |
import os | |
import re | |
import pandas as pd | |
from nltk.tokenize import word_tokenize | |
from nltk.corpus import stopwords | |
from nltk.stem import WordNetLemmatizer | |
import nltk | |
from wordcloud import WordCloud, STOPWORDS |
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
class GMM: | |
""" Gaussian Mixture Model | |
Parameters | |
----------- | |
k: int , number of gaussian distributions | |
seed: int, will be randomly set if None | |
max_iter: int, number of iterations to run algorithm, default: 200 |
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
class GMM: | |
""" Gaussian Mixture Model | |
Parameters | |
----------- | |
k: int , number of gaussian distributions | |
seed: int, will be randomly set if None | |
max_iter: int, number of iterations to run algorithm, default: 200 |
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 mysql.connector | |
from mysql.connector import Error | |
import tweepy | |
import json | |
from dateutil import parser | |
import time | |
import os | |
import subprocess | |
#importing file which sets env variable |
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 mysql.connector | |
from mysql.connector import Error | |
import os | |
import re | |
import pandas as pd | |
from nltk.tokenize import word_tokenize | |
from nltk.corpus import stopwords | |
from nltk.stem.porter import PorterStemmer | |
from nltk.stem import WordNetLemmatizer | |
import nltk |
NewerOlder