Skip to main content

Competition-oriented framework for interactive feature engineering and building reproducible pipelines

Project description

kts

kts was created to simplify and unify process of solving machine learning competitions.

Key Principles

  • Feature engineering is modular:
    • Each feature engineering function represents a block of features: takes an input dataframe and produces a new one with only new features
    • Such functions called feature constructors are then assebmled into feature sets which are then used for training models
    • Features are computed once, then they are loaded from cache
  • A pair of a model and a feature set is validated using a given metric and cross validation splitter
  • Once experiment is conducted, it is placed to your local leaderboard, trained models and sources are saved
  • Each experiment is given an ID, which is used to access it
  • Each experiment can produce predictions for any dataframe which has same columns as a training one: feature engineering is done automatically, then features are fed to trained models

Features

  • We support features which should be computed differently for training set and validation set: they are implemented as simply as usual ones using special syntax (df.train and df.encoders attributes of a dataframe passed to function)
  • User cache: you can store any objects to access them from other notebooks of your project with kts.save and kts.load
  • Standard library: some common feature generation techniques are preimplemented, like target or one hot encoding; you can use their sources to borrow best practices of writing custom feature constructors in kts style
  • Designed for multiple notebook environment: cache is synchronized between notebooks, e.g. you can change source of a feature constructor in one notebook and get it automatically changed in other one; same for objects
  • Stacking is as simple as kts.stack(IDs): it creates a standard feature constructor which can be used for feature set creation
  • Feature selection: select best features from an experiment using built-in feature importances calculator (sklearn-style) or permutation importance. You can also implement your own feature importance calculator using our base class

Getting started

Use $ pip3 install kts to install the latest version from PyPI.
Check kts-examples repo to learn basics.

Command line interface

Use it to create a new project:

$ mkdir project
$ cd project
$ kts init

or download an example from kts-examples repo:

$ kts example titanic

Contribution

Contact me in Telegram or ODS Slack to share any thoughts about the framework or examples. You're always welcome to propose new features or even implement them.

Acknowledgements

Core of the project was designed and implemented by the team of Mikhail Andronov, Roman Gorb and Nikita Konodyuk under the mentorship of Alexander Avdyushenko during a project practice held by Yandex and Higher School of Economics on 1-14 February 2019 at Educational Center «Sirius».

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kts-0.2.43.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kts-0.2.43-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file kts-0.2.43.tar.gz.

File metadata

  • Download URL: kts-0.2.43.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.6.1

File hashes

Hashes for kts-0.2.43.tar.gz
Algorithm Hash digest
SHA256 345fad660dd1b86337961af16890435cee71e4f2b249ac9e60869a00c281a02e
MD5 6eb868519df32523da0acd14b81f5447
BLAKE2b-256 90dbdaf2a51ddfc4590fe2f4d31abb2c69f60e44362e828e59cf6954b2efe86a

See more details on using hashes here.

File details

Details for the file kts-0.2.43-py3-none-any.whl.

File metadata

  • Download URL: kts-0.2.43-py3-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.6.1

File hashes

Hashes for kts-0.2.43-py3-none-any.whl
Algorithm Hash digest
SHA256 d145192d196ef3815daf1dbec02d82c1c95fbf89efeae24f5f7e6b233f239204
MD5 d1b488ee9e8c8b30587417a8e4d29f0b
BLAKE2b-256 98da56cf233dacec109eb0d29cf99551d154e58e12d45b8931820a1998f8b760

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page