code: def get_class_weighted_cross_entropy(y_train, mu=1.0):
      assert (
          y_train.ndim == 1
      ), "Utility function only works for binary classification"
      y_train = LabelEncoder().fit_transform(y_train)
      weights = _make_smooth_weights_for_balanced_classes(
          y_train, mu=mu
      )
      criterion = torch.nn.CrossEntropyLoss(
          weight=torch.FloatTensor(weights)
      )
      return criterion
  
file_path: pytorch_tabular/src/pytorch_tabular/utils/data_utils.py
imports: import gzip
  import os
  import random
  import shutil
  import numpy
  import pandas
  import requests
  import torch
  from pandas import DataFrame, Series
  from sklearn.cluster import KMeans
  from sklearn.datasets import make_classification, make_regression
  from sklearn.preprocessing import LabelEncoder
  from .logger import get_logger
label_desc: Use image node_id 2 for calling a global function with example usage: get_class_weighted_cross_entropy(y_train, mu) and returns: criterion