Skip to main content

Geographical Transctions clustering algorithm

Name of the module stands for geographical transactions clustering. This module is an implementation of the method, developed for the third course project in HSE University. It takes dataframe with clients transactions history of the specified format and returns list of clusters.

For the record, it was intended to be for public usage in this form, as it is a research project seeking to find a way to deal with the described problem

Installation

Run the following to install:

‘’’python

pip install geot_cluster’’’

Usage

Before using make sure, that your dataset corresponds with requirements. Csv file must contain the following columns in order to work correctly

  • user_id : string type, example: “423156821”

  • event_dt : string type, example: “20190312”

  • event_time: string type, example: “2019-03-12 06:24:00.279”

  • lattitude : float type, example: 49.862621

  • longtitude: see lattitude

Workflow:

import geot_cluster

import markov_clustering as mc
import matplotlib.pyplot as plt
import networkx as nx


path = [path to file with data]
data, names = geot_cluster.data_load(path)


%matplotlib notebook
base = [path to the folder, where to store libs with information about clients]

archivate = True
libs= True
graph_f = True
cluster_f = True


if(archivate):
    geot_cluster.archivate_maps(data, names, levels=4)

if(libs):
    lib = geot_cluster.graph_preparation(data, names, base)
    prob_lib = geot_cluster.znakomstvo_by_lib(lib,data)

lib, prob_lib = load_libs(base = base)

if(graph_f):
    graph = geot_cluster.graph_forming(lib, prob_lib, treshold=0.9)

if(cluster_f):
    result = mc.run_mcl(graph,pruning_threshold=0.7, inflation=2,expansion=2)
    clusters = mc.get_clusters(result)

    clust_0 = clusters_to_ids(lib=lib, prob_lib=prob_lib, clusters = clusters, number = 0)
    maps = get_cluster_maps(data = data, clust = clust_0)
    print("Number of clusters", len(clusters))

    plt.figure(figsize=(10,10))
    mc.drawing.draw_graph(result, clusters, edge_color="red",node_size=15,width = 1, with_labels=True, font_size = 8)

Metadata

Release files for geot-cluster 0.9.29

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geot-cluster 0.9.29
File Size Uploaded Provenance Actions
geot_cluster-0.9.29.tar.gz 12.8 kB Without provenance Details for geot_cluster-0.9.29.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geot-cluster 0.9.29
File Interpreter ABI Platform Actions
geot_cluster-0.9.29-py3-none-any.whl Python 3 none any Details for geot_cluster-0.9.29-py3-none-any.whl

Total release size: 27.8 kB

Release files / geot_cluster-0.9.29.tar.gz

Download URL geot_cluster-0.9.29.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fb30e99295f0493cf082a0bdc6542cc8ea1a3f7ff7fed9c214c8ca5cf3f60b95
BLAKE2b-256 checksum
How to use checksums
027fa91d4590adbbe5aeda042b6c006f40f61ac57e35c3dcfc4e7b36b7fa2189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.17

Release files / geot_cluster-0.9.29-py3-none-any.whl

Download URL geot_cluster-0.9.29-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60463bcd72bd13a4ba2606e223c7532a6a12d86bab7bab1c71740963c119bfee
BLAKE2b-256 checksum
How to use checksums
c44d2592f508cef27840a42fa0d68bc31febbf2f7825f61c29daba359daaed68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.17

Security for geot-cluster 0.9.29

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page