The following problems are equvalent of Grokking the coding interview course, and solutions are also attached
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
# Authors: Mathieu Blondel, Vlad Niculae | |
# License: BSD 3 clause | |
import numpy as np | |
def _gen_pairs(gen, max_iter, max_inner, random_state, verbose): | |
rng = np.random.RandomState(random_state) | |
# if tuple, interpret as randn |
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 os | |
import pandas as pd | |
from sklearn.model_selection import train_test_split, StratifiedKFold | |
from sklearn.metrics import classification_report, confusion_matrix, log_loss, accuracy_score, roc_auc_score | |
import numpy as np | |
from catboost import CatBoostClassifier, Pool, cv | |
from datetime import date, timedelta | |
#import shap | |
import matplotlib.pyplot as pl | |
#from imblearn.over_sampling import SMOTENC |