<NME> app_br_lr.properties
<BEF> ########## IO ###########
# top level folder for all outputs
output.folder=/huge1/people/chengli/projects/pyramid/archives/app3/ohsumed_20000/1
# the name of the train folder
output.trainFolder=train
# the name of the test folder
output.testFolder=test
# the name of the validation folder
output.validFolder=valid
# the name of the calibration folder
output.calibrationFolder=cali
# users can train mulitple models using different hyper parameters and save them to different folders (e.g., lr, gb, gb2)
output.modelFolder=lr
# users can train mulitple calibrators using different calibrator types and data sources and store them in differt folders
output.calibratorFolder=mgh_label_iso_set_reranker
# the full name of the log file
# if not given, the log will be printed to the console
output.log=

######### functions ##########
# use two queries to specify training set and test set
# the query string should be the string after the top level "query":
# For example, if the curl command is
# curl -XGET "http://localhost:9200/ohsumed_20000/document/_search" -d'{"query":{"filtered":{"query":{"match_all":{}},"filter":{"term":{"split":"train"}}}}}'
# then the query string should be {"filtered":{"query":{"match_all":{}},"filter":{"term":{"split":"train"}}}}
# make sure the curly braces match

# the elasticsearch query string for matching training documents
train.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "train"}}}}
# the elasticsearch query string for matching test documents
test.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "test"}}}}
# the elasticsearch query string for matching validation documents
valid.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "valid"}}}}
# the elasticsearch query string for matching calibration documents
calibration.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "cali"}}}}

# generate training set
createTrainSet=true
# generate test set
createTestSet=true
# generate validation set
createValidSet=true
# generate calibration set
createCalibrationSet=true


# train model; produce reports for training set; train should be run prior to test
train=true
# after "train", run "calibrate" to calibrate probabilities
# calibration is necessary if predict.target=subsetAccuracy
calibrate=true
#tune confidence threshold for accuracy target on valid set
tuneCTAT=true
# load model, produce reports for validation set
validate=true
# load model; produce reports for test set
test=true


########## index ########## 
index.indexName=ohsumed_20000
index.clusterName=fijielasticsearch
index.documentType=document
# node or transport
index.clientType=node
# set hosts if clientType=transport
index.hosts=fiji11,fiji12
# set ports if clientType=transport
index.ports=9300,9300



######### feature ########## 
train.feature.useInitialFeatures=true
train.feature.featureFieldPrefix=feature
train.feature.categFeature.filter=true
train.feature.categFeature.percentThreshold=0.1
# if true, ngrams can have repeated words; if false, we only keep ngrams in which all words are distinct
train.feature.ngram.allowDuplicateWords=true
# if true, ngrams can have repeated words; if false, we only keep ngrams in which all words are distinct
train.feature.ngram.allowDuplicateWords=true
train.feature.ngram.n=1,2
# how frequent an ngram needs to be in order to be considered as a feature
# the minimum fraction of documents containing the ngram; 0.02 means 2 percent
train.feature.ngram.minDf=0.02
train.feature.ngram.slop=0,1
train.feature.ngram.extractionFields=body
# can be es_original, frequency, binary, tfifl
# tfifl = term frequency normalized by field length;
# to use tfifl, users should manually store the field length in a separate field named <field_name>_field_length, e.g., body_field_length
train.feature.ngram.matchScoreType=es_original

# whether to perform feature selection for ngrams
train.feature.ngram.selection=false
# if selection=true, how many ngrams to keep for each label
train.feature.ngram.selectPerLabel=50

train.feature.missingValue=false

train.feature.missingValue=false

train.feature.addExternalNgrams=false
# the file containing user specified ngrams, one ngram per line
# users do not need to manually analyze (tokenize, stem, filter) these ngrams, but need to specify the right analyzer below
train.feature.externalNgramFile=/home/chengli/experiments/pyramid/application/app3/configs/ohsumed_20000/ngramlist

# whether to filter ngram candidates based on a list of unigram keywords 
# if true, only ngrams (n>1) containing at least one of the keywords will be kept
train.feature.filterNgramsByKeyWords=false
# the file containing unigram keywords, one unigram per line
# users do not need to manually analyze (tokenize, stem, filter) these unigrams, but need to specify the right analyzer below
train.feature.filterNgrams.keyWordsFile=/home/chengli/experiments/pyramid/application/app3/configs/ohsumed_20000/keywords

# the program will use this analyzer to analyze (tokenize, stem, filter) the user provided ngrams and unigram keywords
# this analyzer should be the same as the one specified in the Elasticsearch body field mapping
# the program will use this analyzer to analyze (tokenize, stem, filter) the user provided ngrams and unigram keywords

# whether to filter ngram candidates by a regular expression
# if true, ngrams matching the regular expression will be removed
train.feature.filterNgramsByRegex=false

# the regular expression used to filter ngrams
# for example, \\d will remove a unigram if it is a digit
# users can specify ngram length in the regular expression using the number of spaces (an ngram has n-1 spaces)
# to help users understand and test the regular expression matching function, pyramid provides another application called "regex"
# users are encouraged to test their regular expression first with "regex"
train.feature.filterNgrams.regex=\\d

# whether to consider code description as features
train.feature.useCodeDescription=false
# whether to consider code description as features
train.feature.useCodeDescription=false
# the file containing code descriptions, each line in the file describes one code
train.feature.codeDesc.File=
# the program will use this analyzer to analyze (tokenize, stem, filter) the code descriptions
# this analyzer should be the same as the one specified in the Elasticsearch body field mapping
train.feature.codeDesc.matchField=body
# As most of the documents would match at least one word in the code description, direct partial matching results in dense features.
# We provide a threshold specifying the minimum percentage of the words in the code description the document must match. 
# Matching below the threshold will be discarded. 
# For example, if the description has 10 terms and a document matches 2 terms and minMatchPercentage=30, the matching score will be set to 0.
# The implementation uses minimum should match query + constance score
# see https://www.elastic.co/guide/en/elasticsearch/guide/current/ignoring-tfidf.html
# The implementation uses minimum should match query + constance score
# see https://www.elastic.co/guide/en/elasticsearch/guide/current/ignoring-tfidf.html
# Matching k out of n words will gives a score of k^2/n^1.5 

########## labels ##############
# the elasticsearch index field for labels
train.label.field=real_labels
train.label.filterByPrefix=false
train.label.filter.prefix=foo
# encode labels in frequency or alphabetical order
train.label.order=frequency
# During training, only consider labels with document count above this (absolute) threshold; set this threshold to 0 if you want consider all labels
train.label.minDF=5
# whether to consider new test labels during evaluation; this option does not affect the actual prediction; new labels will never be predicted;
# setting this paramater to true will include new test labels into the test performance evaluation
test.considerNewLabel=true
# setting this paramater to true will include new test labels into the test performance evaluation
test.considerNewLabel=true
valid.considerNewLabel=true
calibration.considerNewLabel=true
# whether to incorporate instance weights in model training
train.useInstanceWeights=false
# the elasticsearch filed storing instance weights
train.weight.field=weights

############# training algorithm hyper parameters ##########
train.penalty=1E-9
train.l1Ratio=0.7

############ calibration #############

# isotonic or none
calibrate.labelCalibrator=isotonic
# isotonic, cardinality_isotonic, reranker, or none
calibrate.setCalibrator=cardinality_isotonic
calibrate.numCandidates=50
calibrate.reranker.numLeaves=10
# whether to use initial features for calibration
calibrate.reranker.useInitialFeatures=false
# prefixes of feature fields to be used by calibrator
calibrate.reranker.featureFieldPrefix=modality

############ CTAT ###############
# target accuracy for autocoding
CTAT.targetAccuracy=0.9
# the name of the file to save confidence threshold. For example, if the confidence threshold is on mgh with modality CT, then
# we can name it as mgh_CT. If the confidece threshold is on mgh data, then we can name it as mgh
CTAT.name=threshold

CTAT.lowerBound=0.6
CTAT.upperBound=0.9
############ prediction #########
# independent, support, reranker
predict.mode=support


############ report ##################
# When generating prediction reports for individual label probabilities, labels with probabilities below the threshold will not be displayed
# This only make the reports more readable; it does not affect the actual prediction in any way.
report.classProbThreshold=0.2
report.labelSetLimit=10
# whether to show prediction details in Json files
report.showPredictionDetail=false
report.rule.limit=10
report.numDocsPerFile=100
# currently not supported in LR
report.produceHTML=false


# the internal Java class name for this application. 
# users do not need to modify this.
pyramid.class=AppBRLR
report.labelSetLimit=10
# whether to show prediction details in Json files
report.showPredictionDetail=false
# whether to produce the HTML files from Json files
# currently not supported in LR
report.produceHTML=false

# the internal Java class name for this application. 
# users do not need to modify this.
pyramid.class=AppBRLR

<MSG> properties

<DFF> @@ -1,6 +1,6 @@
-########## IO ###########
-# top level folder for all outputs
-output.folder=/huge1/people/chengli/projects/pyramid/archives/app3/ohsumed_20000/1
+########## IO ###########r1
+# folder for all outputs
+output.folder=/mnt/home/cheng/app
 # the name of the train folder
 output.trainFolder=train
 # the name of the test folder
@@ -9,13 +9,13 @@ output.testFolder=test
 output.validFolder=valid
 # the name of the calibration folder
 output.calibrationFolder=cali
-# users can train mulitple models using different hyper parameters and save them to different folders (e.g., lr, gb, gb2)
+
 output.modelFolder=lr
 # users can train mulitple calibrators using different calibrator types and data sources and store them in differt folders
-output.calibratorFolder=mgh_label_iso_set_reranker
+output.calibratorFolder=label_iso_set_reranker_wq
 # the full name of the log file
 # if not given, the log will be printed to the console
-output.log=
+output.log=/mnt/home/cheng/app/log_lr
 
 ######### functions ##########
 # use two queries to specify training set and test set
@@ -26,13 +26,13 @@ output.log=
 # make sure the curly braces match
 
 # the elasticsearch query string for matching training documents
-train.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "train"}}}}
+train.splitQuery={"bool": {"must":[{"range":{"random": {"gte": 0, "lt": 0.7}}},{"match":{"entity":"mgh"}},{"range":{"cdf":{"gte": 0, "lt": 0.95}}}]}}
 # the elasticsearch query string for matching test documents
-test.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "test"}}}}
+test.splitQuery={"bool":{"must":[{"range":{"random":{"gte": 0.7,"lt": 0.8}}},{"match":{"entity":"mgh"}}]}}
 # the elasticsearch query string for matching validation documents
-valid.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "valid"}}}}
+valid.splitQuery={"bool":{"must":[{"range":{"random":{"gte": 0.8,"lt": 0.9}}},{"match":{"entity":"mgh"}}]}}
 # the elasticsearch query string for matching calibration documents
-calibration.splitQuery={"bool": {"must": {"match_all": {}},"filter": {"term": {"split": "cali"}}}}
+calibration.splitQuery={"bool": {"must":[{"range":{"random": {"gte": 0.9, "lt":1.0}}},{"match":{"entity":"mgh"}}]}}
 
 # generate training set
 createTrainSet=true
@@ -43,37 +43,33 @@ createValidSet=true
 # generate calibration set
 createCalibrationSet=true
 
-
 # train model; produce reports for training set; train should be run prior to test
 train=true
-# after "train", run "calibrate" to calibrate probabilities
-# calibration is necessary if predict.target=subsetAccuracy
+# calibrate probabilities
 calibrate=true
-#tune confidence threshold for accuracy target on valid set
+# tune confidence threshold for accuracy target on valid set
 tuneCTAT=true
-# load model, produce reports for validation set
+# load model; produce reports for validation set
 validate=true
 # load model; produce reports for test set
 test=true
 
 
 ########## index ########## 
-index.indexName=ohsumed_20000
-index.clusterName=fijielasticsearch
+index.indexName=entrad-lr-common_20180101_20171001_20180101
+index.clusterName=VobaModelGeneration
 index.documentType=document
 # node or transport
-index.clientType=node
+index.clientType=transport
 # set hosts if clientType=transport
-index.hosts=fiji11,fiji12
+index.hosts=localhost,localhost
 # set ports if clientType=transport
-index.ports=9300,9300
-
-
+index.ports=9300,9200
 
 ######### feature ########## 
 train.feature.useInitialFeatures=true
-train.feature.featureFieldPrefix=feature
-train.feature.categFeature.filter=true
+train.feature.featureFieldPrefix=work_queue
+train.feature.categFeature.filter=false
 train.feature.categFeature.percentThreshold=0.1
 # if true, ngrams can have repeated words; if false, we only keep ngrams in which all words are distinct
 train.feature.ngram.allowDuplicateWords=true
@@ -82,18 +78,18 @@ train.feature.ngram.inOrder=true
 train.feature.ngram.n=1,2
 # how frequent an ngram needs to be in order to be considered as a feature
 # the minimum fraction of documents containing the ngram; 0.02 means 2 percent
-train.feature.ngram.minDf=0.02
-train.feature.ngram.slop=0,1
-train.feature.ngram.extractionFields=body
+train.feature.ngram.minDf=0.001
+train.feature.ngram.slop=0,1,2
+train.feature.ngram.extractionFields=body,ngram_reasonforvisit
 # can be es_original, frequency, binary, tfifl
 # tfifl = term frequency normalized by field length;
 # to use tfifl, users should manually store the field length in a separate field named <field_name>_field_length, e.g., body_field_length
-train.feature.ngram.matchScoreType=es_original
+train.feature.ngram.matchScoreType=tfifl
 
 # whether to perform feature selection for ngrams
 train.feature.ngram.selection=false
 # if selection=true, how many ngrams to keep for each label
-train.feature.ngram.selectPerLabel=50
+train.feature.ngram.selectPerLabel=100
 
 train.feature.missingValue=false
 
@@ -102,14 +98,14 @@ train.feature.missingValue=false
 train.feature.addExternalNgrams=false
 # the file containing user specified ngrams, one ngram per line
 # users do not need to manually analyze (tokenize, stem, filter) these ngrams, but need to specify the right analyzer below
-train.feature.externalNgramFile=/home/chengli/experiments/pyramid/application/app3/configs/ohsumed_20000/ngramlist
+train.feature.externalNgramFile=
 
-# whether to filter ngram candidates based on a list of unigram keywords 
+# whether to filter ngram candidates based on a list of unigram keywords
 # if true, only ngrams (n>1) containing at least one of the keywords will be kept
 train.feature.filterNgramsByKeyWords=false
 # the file containing unigram keywords, one unigram per line
 # users do not need to manually analyze (tokenize, stem, filter) these unigrams, but need to specify the right analyzer below
-train.feature.filterNgrams.keyWordsFile=/home/chengli/experiments/pyramid/application/app3/configs/ohsumed_20000/keywords
+train.feature.filterNgrams.keyWordsFile=
 
 # the program will use this analyzer to analyze (tokenize, stem, filter) the user provided ngrams and unigram keywords
 # this analyzer should be the same as the one specified in the Elasticsearch body field mapping
@@ -117,14 +113,14 @@ train.feature.analyzer=english
 
 # whether to filter ngram candidates by a regular expression
 # if true, ngrams matching the regular expression will be removed
-train.feature.filterNgramsByRegex=false
+train.feature.filterNgramsByRegex=true
 
 # the regular expression used to filter ngrams
 # for example, \\d will remove a unigram if it is a digit
 # users can specify ngram length in the regular expression using the number of spaces (an ngram has n-1 spaces)
 # to help users understand and test the regular expression matching function, pyramid provides another application called "regex"
 # users are encouraged to test their regular expression first with "regex"
-train.feature.filterNgrams.regex=\\d
+train.feature.filterNgrams.regex=((.*) )*\\d{3,}+( (.*))*
 
 # whether to consider code description as features
 train.feature.useCodeDescription=false
@@ -137,7 +133,7 @@ train.feature.codeDesc.analyzer=english
 train.feature.codeDesc.matchField=body
 # As most of the documents would match at least one word in the code description, direct partial matching results in dense features.
 # We provide a threshold specifying the minimum percentage of the words in the code description the document must match. 
-# Matching below the threshold will be discarded. 
+# Matching below the threshold will be discarded.
 # For example, if the description has 10 terms and a document matches 2 terms and minMatchPercentage=30, the matching score will be set to 0.
 # The implementation uses minimum should match query + constance score
 # see https://www.elastic.co/guide/en/elasticsearch/guide/current/ignoring-tfidf.html
@@ -147,13 +143,13 @@ train.feature.codeDesc.minMatchPercentage=20
 
 ########## labels ##############
 # the elasticsearch index field for labels
-train.label.field=real_labels
+train.label.field=array_translated_icd10entry2
 train.label.filterByPrefix=false
-train.label.filter.prefix=foo
+train.label.filter.prefix=
 # encode labels in frequency or alphabetical order
 train.label.order=frequency
 # During training, only consider labels with document count above this (absolute) threshold; set this threshold to 0 if you want consider all labels
-train.label.minDF=5
+train.label.minDF=0
 # whether to consider new test labels during evaluation; this option does not affect the actual prediction; new labels will never be predicted;
 # setting this paramater to true will include new test labels into the test performance evaluation
 test.considerNewLabel=true
@@ -164,52 +160,54 @@ calibration.considerNewLabel=true
 # whether to incorporate instance weights in model training
 train.useInstanceWeights=false
 # the elasticsearch filed storing instance weights
-train.weight.field=weights
+train.weight.field=w12
 
-############# training algorithm hyper parameters ##########
+#### training algorithm hyper parameters #####
 train.penalty=1E-9
 train.l1Ratio=0.7
 
-############ calibration #############
 
+############ calibration #############
+# users can train mulitple calibrators using different calibrator types and data sources and store them in differt folders
 # isotonic or none
 calibrate.labelCalibrator=isotonic
 # isotonic, cardinality_isotonic, reranker, or none
-calibrate.setCalibrator=cardinality_isotonic
+calibrate.setCalibrator=reranker
 calibrate.numCandidates=50
 calibrate.reranker.numLeaves=10
-# whether to use initial features for calibration
-calibrate.reranker.useInitialFeatures=false
-# prefixes of feature fields to be used by calibrator
-calibrate.reranker.featureFieldPrefix=modality
+
+calibrate.reranker.useInitialFeatures=true
+calibrate.reranker.featureFieldPrefix=work_queue
+
 
 ############ CTAT ###############
 # target accuracy for autocoding
 CTAT.targetAccuracy=0.9
-# the name of the file to save confidence threshold. For example, if the confidence threshold is on mgh with modality CT, then
-# we can name it as mgh_CT. If the confidece threshold is on mgh data, then we can name it as mgh
+# name of the file that saves confidence threshold. 
+# users can tune multiple thresholds and save them to different files
 CTAT.name=threshold
-
 CTAT.lowerBound=0.6
 CTAT.upperBound=0.9
+
+
 ############ prediction #########
 # independent, support, reranker
-predict.mode=support
+predict.mode=reranker
 
 
 ############ report ##################
+report.rule.limit=10
+report.numDocsPerFile=100
 # When generating prediction reports for individual label probabilities, labels with probabilities below the threshold will not be displayed
 # This only make the reports more readable; it does not affect the actual prediction in any way.
 report.classProbThreshold=0.2
 report.labelSetLimit=10
 # whether to show prediction details in Json files
 report.showPredictionDetail=false
-report.rule.limit=10
-report.numDocsPerFile=100
+# whether to produce the HTML files from Json files
 # currently not supported in LR
 report.produceHTML=false
 
-
 # the internal Java class name for this application. 
 # users do not need to modify this.
-pyramid.class=AppBRLR
\ No newline at end of file
+pyramid.class=AppBRLR

properties