def abalone(verbose=False, show_plots=False):
    X_train, X_test, y_train, y_test = data_proc.process_abalone()

    run_experiment('abalone',
                   X_train,
                   X_test,
                   y_train,
                   y_test,
                   verbose=verbose,
                   show_plots=show_plots)
Example #2
0
def abalone(kernels, verbose=False, show_plots=False):
    X_train, X_test, y_train, y_test = data_proc.process_abalone()

    for col in X_train.columns:
        X_train[col] = data_proc.scale_data(X_train[col])
        X_test[col] = data_proc.scale_data(X_test[col])

    for kernel in kernels:
        run_experiment(kernel,
                       'abalone',
                       X_train,
                       X_test,
                       y_train,
                       y_test,
                       verbose=verbose,
                       show_plots=show_plots)
Example #3
0
def abalone(verbose=False):
    X, y = data_proc.process_abalone(scaler='minmax')
    run_k_means('abalone', X, y, verbose=verbose)
    run_expect_max('abalone', X, y, verbose=verbose)
Example #4
0
def abalone_cluster(verbose=False, show_plots=False):
    X, y = data_proc.process_abalone(scaler='minmax', tt_split=False)

    # calculate baseline performance
    base_X_train, base_X_test, base_y_train, base_y_test = data_proc.process_abalone(
        tt_split=True)
    run_experiment(
        'abalone',
        'baseline',
        base_X_train,
        base_X_test,
        base_y_train,
        base_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose:
        print("\nBaseline complete!\n", "------------------------------\n")

    # calculate K-means performance
    k_means_X_clusters = clustering.run_k_means('abalone',
                                                X,
                                                y,
                                                dim_reduction=None,
                                                verbose=verbose)
    k_means_X_train, k_means_X_test, k_means_y_train, k_means_y_test = data_proc.process_abalone_w_clusters(
        k_means_X_clusters, scaler='minmax')

    run_experiment(
        'abalone',
        'kmeans',
        k_means_X_train,
        k_means_X_test,
        k_means_y_train,
        k_means_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose:
        print("\nK-means complete!\n", "------------------------------\n")

    # calculate Expectation Maximization performance
    em_X_clusters = clustering.run_expect_max('abalone',
                                              X,
                                              y,
                                              dim_reduction=None,
                                              verbose=verbose)
    em_X_train, em_X_test, em_y_train, em_y_test = data_proc.process_abalone_w_clusters(
        em_X_clusters, scaler='minmax')

    run_experiment(
        'abalone',
        'em',
        em_X_train,
        em_X_test,
        em_y_train,
        em_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose:
        print("\nExpectation Maximization complete!\n",
              "------------------------------\n")
Example #5
0
def abalone_dr(verbose=False, show_plots=False):
    X, y = data_proc.process_abalone(scaler='minmax', tt_split=False)

    # calculate baseline performance
    base_X_train, base_X_test, base_y_train, base_y_test = data_proc.process_abalone(
        tt_split=True)
    run_experiment(
        'abalone',
        'baseline',
        base_X_train,
        base_X_test,
        base_y_train,
        base_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose:
        print("\nBaseline complete!\n", "------------------------------\n")

    # calculate PCA performance
    pca_X = dim_reduction.run_pca('abalone', X, y, verbose=verbose)
    pca_X_train, pca_X_test, pca_y_train, pca_y_test = train_test_split(
        pca_X, y)
    run_experiment(
        'abalone',
        'pca',
        pca_X_train,
        pca_X_test,
        pca_y_train,
        pca_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose: print("\nPCA complete!\n", "------------------------------\n")

    # calculate ICA performance
    ica_X = dim_reduction.run_ica('abalone', X, y, verbose=verbose)
    ica_X_train, ica_X_test, ica_y_train, ica_y_test = train_test_split(
        ica_X, y)
    run_experiment(
        'abalone',
        'ica',
        ica_X_train,
        ica_X_test,
        ica_y_train,
        ica_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose: print("\nICA complete!\n", "------------------------------\n")

    # calculate RP performance
    rp_X = dim_reduction.run_rp('abalone', X, y, verbose=verbose)
    rp_X_train, rp_X_test, rp_y_train, rp_y_test = train_test_split(rp_X, y)
    run_experiment(
        'abalone',
        'rp',
        rp_X_train,
        rp_X_test,
        rp_y_train,
        rp_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose: print("\nRP complete!\n", "------------------------------\n")

    # calculate DT_FI performance
    dt_fi_X = dim_reduction.run_dt_fi('abalone', X, y, verbose=verbose)
    dt_fi_X_train, dt_fi_X_test, dt_fi_y_train, dt_fi_y_test = train_test_split(
        dt_fi_X, y)
    run_experiment(
        'abalone',
        'dt_fi',
        dt_fi_X_train,
        dt_fi_X_test,
        dt_fi_y_train,
        dt_fi_y_test,
        verbose=verbose,
        show_plots=show_plots,
    )
    if verbose:
        print("\nDT_FI complete!\n", "------------------------------\n")
Example #6
0
def abalone(verbose=False):
    X, y = data_proc.process_abalone(scaler='minmax', tt_split=False)
    run_pca('abalone', X, y, verbose=verbose)
    run_ica('abalone', X, y, verbose=verbose)
    run_rp('abalone', X, y, verbose=verbose)
    run_dt_fi('abalone', X, y, verbose=verbose)