def scatter():
    entity_name = request.args.get('entity', None)
    entity = db.tables[entity_name]

    predictable_features = [{"name":c.metadata["real_name"], "id":c.name}  for c in predict.get_predictable_features(entity)]
    print dir(utils)
    features = web_utils.get_scatter_features(entity)

    template_data = {
        "entity_name" : entity_name,
        'features' : features,
        'features_str' : json.dumps(features),
        'num_features': len(features),
    }
    return render_template('scatter.html', **template_data)
def scatter():
    entity_name = request.args.get('entity', None)
    entity = db.tables[entity_name]

    predictable_features = [{
        "name": c.metadata["real_name"],
        "id": c.name
    } for c in predict.get_predictable_features(entity)]
    print dir(utils)
    features = web_utils.get_scatter_features(entity)

    template_data = {
        "entity_name": entity_name,
        'features': features,
        'features_str': json.dumps(features),
        'num_features': len(features),
    }
    return render_template('scatter.html', **template_data)
def analyze():
    entity_name = request.args.get('entity', None)
    entity = db.tables[entity_name]

    predictable_features = [{"name":c.metadata["real_name"], "id":c.name}  for c in predict.get_predictable_features(entity)]
    features = [{"name":c.metadata["real_name"], "id":c.name} for c in entity.get_column_info()]

    # random.shuffle(features)

    template_data = {
        "entity_name" : entity_name,
        "predictable_features": predictable_features,
        'features' : features,
        'features_str' : json.dumps(features),
        'num_features': len(features),
        'num_rec_features' : 2+random.randint(0,4)
    }
    return render_template('analyze.html', **template_data)
def analyze():
    entity_name = request.args.get('entity', None)
    entity = db.tables[entity_name]

    predictable_features = [{
        "name": c.metadata["real_name"],
        "id": c.name
    } for c in predict.get_predictable_features(entity)]
    features = [{
        "name": c.metadata["real_name"],
        "id": c.name
    } for c in entity.get_column_info()]

    # random.shuffle(features)

    template_data = {
        "entity_name": entity_name,
        "predictable_features": predictable_features,
        'features': features,
        'features_str': json.dumps(features),
        'num_features': len(features),
        'num_rec_features': 2 + random.randint(0, 4)
    }
    return render_template('analyze.html', **template_data)