import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn import preprocessing

class abt_lda:
    def __init__(self, x, n_components, preprocess=True):
        self.x = x
        self.preprocess = preprocess
        self.n_components = n_components

        if self.preprocess:
            self.Xscaler = preprocessing.StandardScaler().fit(self.x)
            self.x = self.Xscaler.transform(self.x)

    def construct_lda_model(self):
        self.lda = PCA(self.n_components)
        self.lda.fit(self.x)

