text_plain_output_1.png
import math
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', None)
from pathlib import Path
from plotnine import *
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers, models, Sequential
from tensorflow.keras import backend as K
import tensorflow_ranking as tfr
from sklearn.model_selection import StratifiedKFold, KFold
from sklearn.preprocessing import LabelEncoder, MinMaxScaler, StandardScaler, QuantileTransformer, RobustScaler
from sklearn.metrics import log_loss
from colorama import Fore, Back, Style
from tqdm import tqdm
from umap import UMAP
from sklearn.decomposition import PCA
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
def map3(y_true, y_pred, **kwargs):
    map3_metric = tfr.keras.metrics.MeanAveragePrecisionMetric(topn=3)
    return map3_metric(y_true, y_pred, **kwargs).numpy()
RANDOM_STATE = 42
INCLUDE_ORIGINAL = False