Beispiel #1
0
def read_file_predict(context_id, context_token, file_id, params_id,
                      scaler_id):
    params = mesatee.mesatee_read_file(context_id, context_token, params_id)
    scaler = mesatee.mesatee_read_file(context_id, context_token, scaler_id)
    params = marshal.loads(params)
    scaler = marshal.loads(scaler)
    content = mesatee.mesatee_read_file(context_id, context_token, file_id)
    featureData = []
    labelData = []
    lines = content.strip().split('\n')
    for line in lines:
        line = line.strip().split(',')
        featureData.append(line)

    feature = np.multiarray.array(featureData, dtype='float64')
    return feature, params, scaler
def save_file_for_task_creator(context_id, context_token):
    content = "save_file_for_task_creator"
    saved_id = mesatee.mesatee_save_file_for_task_creator(
        context_id, context_token, content)
    content_from_file = mesatee.mesatee_read_file(context_id, context_token,
                                                  saved_id)
    if content_from_file == content: return True
    else: return False
def save_file_for_file_owner(context_id, context_token, file_id):
    content = "save_file_for_file_owner"
    saved_id = mesatee.mesatee_save_file_for_file_owner(
        context_id, context_token, file_id, content)
    content_from_file = mesatee.mesatee_read_file(context_id, context_token,
                                                  saved_id)
    if content_from_file == content: return True
    else: return False
def save_file_for_all_participants(context_id, context_token):
    content = "save_file_for_all_participants"
    saved_id = mesatee.mesatee_save_file_for_all_participants(
        context_id, context_token, content)
    content_from_file = mesatee.mesatee_read_file(context_id, context_token,
                                                  saved_id)
    if content_from_file == content: return True
    else: return False
Beispiel #5
0
def read_file_train(context_id, context_token, file_id):
    content = mesatee.mesatee_read_file(context_id, context_token, file_id)
    featureData = []
    labelData = []
    lines = content.strip().split('\n')
    for line in lines:
        line = line.strip().split(',')
        featureData.append(line[:-1])
        labelData.append(line[-1])
    label = np.multiarray.array(labelData, dtype='float64').reshape(-1, 1)
    feature = np.multiarray.array(featureData, dtype='float64')
    return feature, label
def read_file(context_id, context_token, file_id):
    content = mesatee.mesatee_read_file(context_id, context_token, file_id)
    if content == "testdata\n": return True
    else: return False
def read_file(context_id, context_token, file_id):
    content = mesatee.mesatee_read_file(context_id, context_token, file_id)
    if content.startswith("Lorem ipsum dolor sit amet"): return True
    else: return False