{"repo":"KarelZe/tclf","free":true,"listed":false,"github":"https://github.com/KarelZe/tclf","clone":"git clone https://github.com/KarelZe/tclf.git","description":"A scikit-learn compatible classifier to perform trade classification in Python.","language":"Python","stars":21,"topics":["python","rule-based-classifier","scikit-learn","trade-classification","empirical","finance","microstructure"],"license":"BSD-3-Clause","category":"analytics","readme_excerpt":"Trade Classification With Python Documentation ✒️: https://karelze.github.io/tclf/ Source Code 🐍: https://github.com/KarelZe/tclf tclf is a scikit-learn -compatible implementation of trade classification algorithms to classify financial markets transactions into buyer- and seller-initiated trades. The key features are: Easy : Easy to use and learn. Sklearn-compatible : Compatible to the sklearn API. Use sklearn metrics and visualizations. Feature complete : Wide range of supported algorithms. Use the algorithms individually or stack them like LEGO blocks. DataFrame-agnostic : Works with any narwhals-compatible DataFrame, including pandas, Polars, and cuDF. Installation pip uv⚡ Supported Algorithms - (Rev.) CLNV rule[^1] - (Rev.) EMO rule[^2] - (Rev.) LR algorithm[^6] - (Rev.) Tick test[^5] - Depth rule[^3] - Quote rule[^4] - Tradesize rule[^3] For a primer on trade classification rules visit the rules section 🆕 in our docs. Minimal Example Let's start simple: classify all trades by the quote rule and all other trades, which cannot be classified by the quote rule, randomly. tclf accepts any narwhals-compatible DataFrame — pandas, Polars, cuDF, and more — as well as plain numpy arrays. Polars pandas Run your script with In this example, input data has columns conforming to our naming conventions. The parameter layers=[(\"quote\", \"ex\")] sets the quote rule at the exchange level and strategy=\"random\" specifies the fallback strategy for unclassified trades. Advanced Example Often","default_branch":null,"files":null,"tree":[],"storefront":"/r/KarelZe","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/KarelZe/tclf/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}