def __databasePicker(): errorCount = 10 while errorCount >= 0: try: # Choose DB Mode print '\n\nChoose Database: (1)SQLITE (2)MYSQL' choice = raw_input('\tPlease enter a database number if you desire, or "!q" to quit: ') if choice == '!q': return None modes = [SQLITE_MODE, MYSQL_MODE] DB_mode = modes[int(choice)-1] # Choose EMF Mode print '\n\nChoose Database: (1)TEMP (2)TEST (3)QA (4)PROD' choice = raw_input('\tPlease enter a database number if you desire, or "!q" to quit: ') if choice == '!q': return None modes = [TEMP_MODE, TEST_MODE, QA_MODE, PROD_MODE] EMF_mode = modes[int(choice)-1] # Connect and Return return get_DB_Handle(EMF_mode=EMF_mode, DB_mode=DB_mode, allow_delete=False) except Exception as e: print 'ERROR: ' print e print 'Will auto-quit after another {0} errors'.format(errorCount) errorCount -= 1 return None
def main(): DB_MODE = settings.DB_MODE EMF_MODE = settings.EMF_MODE hndl_Log = EMF_Logging_Handle(mode=EMF_MODE) hndl_DB = get_DB_Handle(EMF_mode=EMF_MODE, DB_mode=DB_MODE) runner_PCA = EMF_PCA_Runner(hndl_DB) runner_PCA.set_model_from_template(CURRENT_TEMPLATE) runner_PCA.add_data() runner_PCA.run_PCA()
def main(): DB_MODE = settings.DB_MODE EMF_MODE = settings.EMF_MODE hndl_Log = EMF_Logging_Handle(mode=EMF_MODE) hndl_DB = get_DB_Handle(EMF_mode=EMF_MODE, DB_mode=DB_MODE) rnnr_Model = EMF_Model_Runner(hndl_DB) rnnr_Model.set_model_from_template(CURRENT_MODEL) for i in xrange(NUM_TRAIN_RUNS): hndl_Res = rnnr_Model.train_model_batch() EMF_JSON_Handle().generate_d3_JSON_ParallelCoords(hndl_Res)
def main(): DB_MODE = settings.DB_MODE EMF_MODE = settings.EMF_MODE # Start Log hndl_Log = EMF_Logging_Handle(mode=EMF_MODE) # Get DB hndl_DB = get_DB_Handle(EMF_mode=EMF_MODE, DB_mode=DB_MODE) # Start Quandl_Runner rnnr_Quandl = EMF_Quandl_Runner(hndl_DB, EMF_mode=EMF_MODE) # Start Download rnnr_Quandl.download_CSV_datasets()
def main(): DB_MODE = settings.DB_MODE EMF_MODE = settings.EMF_MODE # Start Log hndl_Log = EMF_Logging_Handle(mode=EMF_MODE) # Get DB hndl_DB = get_DB_Handle(EMF_mode=EMF_MODE, DB_mode=DB_MODE) # Get DataSeries allTickers = retrieve_DataSeries_All(hndl_DB.cursor, column=TICKER) for ticker_ in allTickers: hndl_Data = EMF_DataSeries_Handle(hndl_DB, ticker=ticker_) hndl_Data
def main(): DB_MODE = settings.DB_MODE EMF_MODE = settings.EMF_MODE hndl_Log = EMF_Logging_Handle(mode=EMF_MODE) hndl_DB = get_DB_Handle(EMF_mode=EMF_MODE, DB_mode=DB_MODE) hndl_WrdSlct = EMF_WordSelector_Handle(hndl_DB) hndl_WrdSlct.pred_trns_ptrns = PredictorTransformationKeys hndl_WrdSlct.resp_trns_ptrns = ResponseTransformationKeys hndl_WrdSlct.resp_trns_ptrns = ['None', 'Futr_Lvl', 'Futr_Change'] hndl_WrdSlct.resp_data_tickers = ['SP500_RealPrice'] hndl_WordSet = EMF_WordSet_Handle(hndl_DB) hndl_WordSet.resp_words = hndl_WrdSlct.select_resp_words_random() hndl_WordSet.pred_words = hndl_WrdSlct.select_pred_words_random()