예제 #1
0
def main(runIndex=None):
    print("Starting Main.main()")

    # if the required directory structure doesn't exist, create it
    makeDirectoryStructure(address)

    # now start the GMM process
    Load.main(address, filename_raw_data, runIndex, subsample_uniform,\
              subsample_random, subsample_inTime, grid, conc, \
              fraction_train, inTime_start, inTime_finish,\
              fraction_nan_samples, fraction_nan_depths, cov_type,\
              run_bic=False)

    # loads data, selects train, cleans, centres/standardises, prints
    PCA.create(address, runIndex, n_dimen, use_fPCA)
    GMM.create(address, runIndex, n_comp, cov_type)
    PCA.apply(address, runIndex)
    GMM.apply(address, runIndex, n_comp)

    # reconstruction (back into depth space)
    Reconstruct.gmm_reconstruct(address, runIndex, n_comp)
    Reconstruct.full_reconstruct(address, runIndex)
    Reconstruct.train_reconstruct(address, runIndex)

    # calculate properties
    mainProperties(address, runIndex, n_comp)
예제 #2
0
def main(run=None):
    print("Starting Main.main()")  
    
    # Now start the GMM process
    Load.main(address, dir_raw_data, run, subsample_uniform, subsample_random,\
               subsample_inTime, grid, conc, fraction_train, inTime_start,\
               inTime_finish, fraction_nan_samples, fraction_nan_depths, dtype)
               
    #Load.main(address, filename_raw_data, run, subsample_uniform, subsample_random,\
        # Loads data, selects Train, cleans, centres/standardises, prints
    
    PCA.create(address, run, n_dimen)     # Uses Train to create PCA, prints results, stores object
    GMM.create(address, run, n_comp)      # Uses Train to create GMM, prints results, stores object
   
    PCA.apply(address, run)               # Applies PCA to test dataset     
    GMM.apply(address, run, n_comp)       # Applies GMM to test dataset
    
    # Reconstruction
    Reconstruct.gmm_reconstruct(address, run, n_comp)  # Reconstructs the results in original space
    Reconstruct.full_reconstruct(address, run)
    Reconstruct.train_reconstruct(address, run)

    # new stuff DD 27/08/18, after seeing updates on DJ github
    #mainProperties(address, runIndex, n_comp)

    
    # Plotting -- first commented out DD
    #Plot.plotMapCircular(address, address_fronts, run, n_comp)
    
    #Plot.plotPosterior(address, address_fronts, run, n_comp, plotFronts=True)
    Plot.plotPostZonal(address, run, n_comp, dtype, plotFronts=False) ## zonal frequencies
    #Plot.plotPosterior(address, run, n_comp, dtype, plotFronts=False) ## works but data overlaps spatially...

    Plot.plotProfileClass(address, run, n_comp, dtype, 'uncentred')
    Plot.plotProfileClass(address, run, n_comp, dtype, 'depth')

    Plot.plotGaussiansIndividual(address, run, n_comp, dtype, 'reduced')#uncentred')#'depth')#reduced')
#    Plot.plotGaussiansIndividual(address, run, n_comp, 'depth') # ERROR NOT WOKRING PROPERLY
#    Plot.plotGaussiansIndividual(address, run, n_comp, 'uncentred') # ERROR NOT WOKRING PROPERLY
    
    #Plot.plotProfile(address, run, dtype, 'original') # these run just fine but are huge and unhelpful
    Plot.plotProfile(address, run, dtype, 'uncentred')
    
    Plot.plotWeights(address, run, dtype)