def test_dim():
    # Get Data
    data_getter = TestDataGetter(10, 9)
    X = data_getter.get_x_data()
    y = data_getter.get_y_data()

    # Shuffle the data and split it
    spliter = DataSpliter(X, y, 0.5, 0, 0.5)
    X_train, y_train = spliter.get_training_set()
    X_test, y_test = spliter.get_testing_set()

    # Dimensionality Reduction
    print("LDA")
    for i in range(1,3):
        dimred = DimensionReduction(X_train, y_train, X_test, i)
        X_reduced_train, X_reduced_test = dimred.lda_data()
        test_GNB(X_reduced_train, y_train, X_reduced_test, y_test, i)

    print("PCA")
    for i in range(1,30):
        dimred = DimensionReduction(X_train, y_train, X_test, i)
        X_reduced_train, X_reduced_test = dimred.pca_data()
        test_GNB(X_reduced_train, y_train, X_reduced_test, y_test, i)

    print("FA")
    for i in range(1,30):
        dimred = DimensionReduction(X_train, y_train, X_test, i)
        X_reduced_train, X_reduced_test = dimred.fa_2D_data()
        test_GNB(X_reduced_train, y_train, X_reduced_test, y_test, i)
def main():
    # Get Data
    data_getter = TestDataGetter(5, 4)
    X = data_getter.get_x_data()
    y = data_getter.get_y_data()

    # Shuffle the data and split it
    spliter = DataSpliter(X, y, 0.6, 0, 0.4)
    X_train, y_train = spliter.get_training_set()
    X_test, y_test = spliter.get_testing_set()

    # Dimensionality Reduction
    dimred = DimensionReduction(X_train, y_train, X_test)
    X_reduced_train, X_reduced_test = dimred.lda_data()

    test_GNB(X_reduced_train, y_train, X_reduced_test, y_test)
def main():
    # Get Data
    data_getter = TestDataGetter(10, 9)
    X = data_getter.get_x_data(used_for="switch")
    y = data_getter.get_y_data(used_for="switch")

    # Data Spliter
    spliter = DataSpliter(X, y, 0.7, 0, 0.3)
    X_train, y_train = spliter.get_training_set()
    X_test, y_test = spliter.get_testing_set()

    # Dimensionality Reduction
    dimred = DimensionReduction(X_train, y_train, X_test)
    X_reduced_train, X_reduced_test = dimred.lda_data()

    # Gaussian Naive Bayes Classifier

    switch_detector(X_reduced_train, y_train, X_reduced_test, y_test)
def main():
    # Get Data
    data_getter = TestDataGetter(5, 4)
    X = data_getter.get_x_data()
    y = data_getter.get_y_data()

    # Shuffle the data and split it
    spliter = DataSpliter(X, y, 0.6, 0, 0.4)
    X_train, y_train = spliter.get_training_set()
    X_test, y_test = spliter.get_testing_set()

    # Dimensionality Reduction
    dimred = DimensionReduction(X_train, y_train, X_test)
    X_reduced_trian, X_reduced_test = dimred.lda_data()

    # K-NN Tester
    # X_test, y_test = spliter.get_testing_set()
    # test_err = test_kNN(X_reduced_trian, y_train, X_reduced_test, y_test, 13)
    # print("Final Test Error: ", test_err)

    # K-NN Ploter
    plot_kNN(X_reduced_trian, y_train)