def getModel(): job = input("Enter the JOB id of the saved model:") run = input("Enter the RUN id of the saved model:") job_name = "SS_job_" + str(job) + "/" run_id = "run_"+str(run) saveDir = getDir(client="SS", typ="TB") model = saveDir+job_name+run_id return model
def getData(): data_dir = getDir(client="SS", typ="ML") df = pd.read_csv(data_dir + FILENM, sep="|") df = df.sample(frac=1.0) # No need for the HH during Testing del df['hh_num'] # Drop any columns with NAN values before = df.shape[0] df = df.dropna(axis=0, how='any') after = df.shape[0] print("{}Deleted {:,.0f} rows out of {:,.0f} due to NAN".format( "\n", (before - after), before)) return df
def getData(): data_dir = getDir(client="SS", typ="ML") df = pd.read_csv(data_dir+FILENM, sep="|") df = df.sample(frac = 1.0) # Save the HH IDs before removing hh = df['hh_num'] del df['hh_num'] # Remove a Label column if there is one try: del df['Label'] except: pass # Drop any columns with NAN values before = df.shape[0] df = df.dropna(axis=0, how='any') after = df.shape[0] print("{}Deleted {:,.0f} rows out of {:,.0f} due to NAN".format( "\n",(before-after), before)) return df, hh
def get_models(job): job_name = "SS_job_" + str(job) + "/" saveDir = getDir(client="SS", typ="TB") for model in glob.glob(saveDir + job_name + '*.meta'): yield model