Beispiel #1
0
def pwc(dataset_name):

    # retrieve dataset
    datastore_ids = filterByPrimaryKey(getDataset(dataset_name))
    data = json.dumps(getDataset(dataset_name))

    return render_template('pwc.html',
                           dataset_name=dataset_name,
                           dataset=datastore_ids,
                           data=data,
                           ranked_data=None,
                           weights=None,
                           confidence=0)
Beispiel #2
0
def explore(dataset_name):

    data = json.dumps(getDataset(dataset_name))

    return render_template('explore.html',
                           weights=None,
                           data=data,
                           dataset_name=dataset_name,
                           list=None)
Beispiel #3
0
def getRanking(dataset_name, primaryKeyPairs):

    # get the dataset from json file in list format
    dataset_list = getDataset(dataset_name)
    # convert each primary key into index in pairs sent from client
    primaryKeyToIndex(dataset_list, primaryKeyPairs)

    pairs_json = json.dumps(primaryKeyPairs)
    pairs = pd.read_json(pairs_json)

    dataset = pd.read_json(json.dumps(dataset_list))

    rank, weights, confidence = build_rank.build(dataset=dataset, pairs=pairs)
    return rank.to_json(orient='records'), weights, confidence