def parse_options()

in cost-based-ml/cost_based_ml.py [0:0]


def parse_options():
	parser = OptionParser(usage="usage: %prog [options]")
	parser.add_option("-m", "--ml-model-id", dest="ml_model_id", help="use Amazon ML model with ML_MODEL_ID")
	parser.add_option("-d", "--test-datasource-id", dest="test_datasource_id", help="use test datasource with TEST_DATASOURCE_ID")
	parser.add_option("-o", "--output-uri-s3", dest="output_uri_s3", help="write model predictions for test dataset to OUTPUT_URI_S3, read from there for cost analysis") 
	parser.add_option("-b", "--batch-prediction-id", dest="batch_prediction_id", help="BATCH_PREDICTION_ID of the already computed batch of predictions for test datasource") 
	parser.add_option("--true-pos", dest="true_pos", help="true positives have cost COST units, 0.0 by default", default=0.0, type='float', metavar='COST') 
	parser.add_option("--true-neg", dest="true_neg", help="true negatives have cost COST units, 0.0 by default", default=0.0, type='float', metavar='COST') 
	parser.add_option("--false-pos", dest="false_pos", help="false positives have cost COST units, 0.0 by default", default=0.0, type='float', metavar='COST') 
	parser.add_option("--false-neg", dest="false_neg", help="false negatives have cost COST units, 0.0 by default", default=0.0, type='float', metavar='COST') 
	(options, args) = parser.parse_args()
	if not options.output_uri_s3:
		print >> sys.stderr, "--output-uri-s3 is required"
		parser.print_help()
		sys.exit(1)
	return (parser, options)