Beispiel #1
0
def run_msms_data(fragment, neutral_loss, mzdiff, ms1, ms2):

    if len(sys.argv) > 1:
        K = int(sys.argv[1])
    else:
        K = 300

    print "Cross-validation for K=" + str(K)
    n_folds = 4
    n_samples = 500
    n_burn = 250
    n_thin = 5
    alpha = 50.0 / K
    beta = 0.1
    is_num_samples = 10000
    is_iters = 1000

    ms2lda = Ms2Lda.lcms_data_from_R(fragment, neutral_loss, mzdiff, ms1, ms2)
    df = ms2lda.df
    vocab = ms2lda.vocab
    cv = CrossValidatorLda(df, vocab, K, alpha, beta)
    cv.cross_validate(n_folds,
                      n_burn,
                      n_samples,
                      n_thin,
                      is_num_samples,
                      is_iters,
                      method="with_mixture")
Beispiel #2
0
def run_msms_data(fragment, neutral_loss, mzdiff, 
                  ms1, ms2):

    if len(sys.argv)>1:
        K = int(sys.argv[1])
    else:
        K = 300
        
    print "Cross-validation for K=" + str(K)
    n_folds = 4
    n_samples = 500
    n_burn = 250
    n_thin = 5
    alpha = 50.0/K
    beta = 0.1
    is_num_samples = 10000
    is_iters = 1000
     
    ms2lda = Ms2Lda.lcms_data_from_R(fragment, neutral_loss, mzdiff, ms1, ms2)    
    df = ms2lda.df
    vocab = ms2lda.vocab
    cv = CrossValidatorLda(df, vocab, K, alpha, beta)
    cv.cross_validate(n_folds, n_burn, n_samples, n_thin, 
                         is_num_samples, is_iters, method="with_mixture")         
Beispiel #3
0
from lda_for_fragments import Ms2Lda

ms2lda = Ms2Lda.resume_from('notebooks/results/beer3pos.project')
ms2lda.do_thresholding(th_doc_topic=0.05, th_topic_word=0.01)
ms2lda.print_topic_words()

special_nodes = [
    ('doc_21213', '#CC0000'), # maroon
    ('doc_21758', 'gold'),
    ('doc_21182', 'green'),
    ('topic_240', '#CC0000'), # maroon
    ('topic_76', 'aqua'),
    ('topic_253', '#ff1493') # deep pink
]
ms2lda.plot_lda_fragments(consistency=0.0, interactive=True, to_highlight=special_nodes)