<commit_before>import root_numpy
import numpy as np
import pandas as pd
import ROOT
from PyAnalysisTools.base import _logger, InvalidInputError
from PyAnalysisTools.ROOTUtils.FileHandle import FileHandle
from PyAnalysisTools.PlottingUtils.PlotConfig import find_process_config, parse_and_build_process_config
from PyAnalysisTools.PlottingUtils.PlotConfig import PlotConfig as pc
import PyAnalysisTools.PlottingUtils.PlottingTools as pt
import PyAnalysisTools.PlottingUtils.Formatting as fm
from PyAnalysisTools.base.OutputHandle import OutputFileHandle
from PyAnalysisTools.PlottingUtils import set_batch_mode
from sklearn.preprocessing import StandardScaler, LabelEncoder, MinMaxScaler


class DataScaler(object):
    def __init__(self, algo="default"):
        self.scale_algo = algo

    @staticmethod
    def get_algos():
        return ["default", "standard", "min_max"]

    def apply_scaling(self, X, y):
        le = LabelEncoder()
        y = le.fit_transform(y)<commit_msg>fix label transformation for application<commit_after>import root_numpy
import numpy as np
import pandas as pd
import ROOT
from PyAnalysisTools.base import _logger, InvalidInputError
from PyAnalysisTools.ROOTUtils.FileHandle import FileHandle
from PyAnalysisTools.PlottingUtils.PlotConfig import find_process_config, parse_and_build_process_config
from PyAnalysisTools.PlottingUtils.PlotConfig import PlotConfig as pc
import PyAnalysisTools.PlottingUtils.PlottingTools as pt
import PyAnalysisTools.PlottingUtils.Formatting as fm
from PyAnalysisTools.base.OutputHandle import OutputFileHandle
from PyAnalysisTools.PlottingUtils import set_batch_mode
from sklearn.preprocessing import StandardScaler, LabelEncoder, MinMaxScaler


class DataScaler(object):
    def __init__(self, algo="default"):
        self.scale_algo = algo

    @staticmethod
    def get_algos():
        return ["default", "standard", "min_max"]

    def apply_scaling(self, X, y):
        le = LabelEncoder()
        if y is not None:
            y = le.fit_transform(y)
{'fraction_non_alphanumeric': 0.05981216015818092, 'fraction_numerical': 0.0, 'mean_word_length': 5.405063291139241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2753284', 'n_tokens_mistral': 575, 'n_tokens_neox': 547, 'n_words': 160}