Пример #1
0
def get_outliers_per_gene(data, gene, method="mad", cutoff=2):
    result = None
    if method == "mad":
        result = out.mad_outliers(data, gene, cutoff)
    elif method == "kmeans":
        result = out.cluster_outliers(data, gene, cutoff)

    return result
Пример #2
0
def stream_detect_outliers_in_data(data, method, min_dist, max_samples, mining_id):
    # if exists -> get from db
    processing_result = None
    store_path = APP_CONFIG["application_files_location"] + APP_CONFIG["application_store_name"]
    data = dr.get_data_frame_from_hdf(data, store_path)
    # For demo purposes (cleaning)
    data = data[-(data.sum(1) <= 5)]
    if method == "kmeans_outliers":
        return om.cluster_outliers(data, data.index, max_samples=max_samples, min_dist=min_dist, mining_id=mining_id)

    if method == "mad":
        return om.mad_outliers(data, data.index, max_samples)