def first_experiment():
    sourcefolder = '../data/'
    metadatapath = '../metadata/mastermetadata.csv'
    vocabpath = '../modeloutput/experimentalvocab.txt'
    tags4positive = {'fantasy_loc', 'fantasy_oclc'}
    tags4negative = {'sf_loc', 'sf_oclc'}
    sizecap = 200
    (metadata, masterdata, classvector, classdictionary, orderedIDs, authormatches, vocablist) = versatiletrainer2.get_simple_data(sourcefolder, metadatapath, vocabpath, tags4positive, tags4negative, sizecap)
    c_range = [0.004, 0.012, 0.3, 0.8, 2]
    featurestart = 3000
    featureend = 4400
    featurestep = 100
    modelparams = ('logistic', 10, featurestart, featureend, featurestep, c_range)
    (matrix, maxaccuracy, metadata, coefficientuples, features4max, best_regularization_coef) = versatiletrainer2.tune_a_model(metadata, masterdata, classvector, classdictionary, orderedIDs, authormatches, vocablist, tags4positive, tags4negative, modelparams, 'first_experiment', '../modeloutput/first_experiment.csv')
    plt.rcParams['figure.figsize'] = [9.0, 6.0]
    plt.matshow(matrix, origin='lower', cmap=plt.cm.YlOrRd)
    plt.show()
def first_experiment():
    sourcefolder = '../data/'
    metadatapath = '../metadata/mastermetadata.csv'
    vocabpath = '../modeloutput/experimentalvocab.txt'
    tags4positive = {'fantasy_loc', 'fantasy_oclc'}
    tags4negative = {'sf_loc', 'sf_oclc'}
    sizecap = 200
    (metadata, masterdata, classvector, classdictionary, orderedIDs, authormatches, vocablist) = versatiletrainer2.get_simple_data(sourcefolder, metadatapath, vocabpath, tags4positive, tags4negative, sizecap)
    c_range = [0.004, 0.012, 0.3, 0.8, 2]
    featurestart = 3000
    featureend = 4400
    featurestep = 100
    modelparams = ('logistic', 10, featurestart, featureend, featurestep, c_range)
    (matrix, maxaccuracy, metadata, coefficientuples, features4max, best_regularization_coef) = versatiletrainer2.tune_a_model(metadata, masterdata, classvector, classdictionary, orderedIDs, authormatches, vocablist, tags4positive, tags4negative, modelparams, 'first_experiment', '../modeloutput/first_experiment.csv')
    plt.rcParams['figure.figsize'] = [9.0, 6.0]
    plt.matshow(matrix, origin='lower', cmap=plt.cm.YlOrRd)
    plt.show()