All Projects → KIC → Pandas Ml Quant

KIC / Pandas Ml Quant

Master repository for the pandas-ml modules

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Pandas Ml Quant

Py Quantmod
Powerful financial charting library based on R's Quantmod | http://py-quantmod.readthedocs.io/en/latest/
Stars: ✭ 155 (+287.5%)
Mutual labels:  pandas, quantitative-finance
Pymarketstore
Python driver for MarketStore
Stars: ✭ 74 (+85%)
Mutual labels:  pandas, quantitative-finance
Finance
Here you can find all the quantitative finance algorithms that I've worked on and refined over the past year!
Stars: ✭ 194 (+385%)
Mutual labels:  pandas, quantitative-finance
Moonshot
Vectorized backtester and trading engine for QuantRocket
Stars: ✭ 88 (+120%)
Mutual labels:  pandas, quantitative-finance
Pandas Technical Indicators
Technical Indicators implemented in Python using Pandas
Stars: ✭ 388 (+870%)
Mutual labels:  pandas, quantitative-finance
Awesome Ai In Finance
🔬 A curated list of awesome machine learning strategies & tools in financial market.
Stars: ✭ 910 (+2175%)
Mutual labels:  quantitative-finance
Data Forge Ts
The JavaScript data transformation and analysis toolkit inspired by Pandas and LINQ.
Stars: ✭ 967 (+2317.5%)
Mutual labels:  pandas
Mgflappy Bird
飞翔的小鸟:是一个飞翔的小鸟通过障碍物得分的小游戏和熊猫(Panda):是一款以熊猫为主题的游戏,你将会化身行动敏捷神速的熊猫
Stars: ✭ 20 (-50%)
Mutual labels:  pandas
Dupandas
📊 python package for performing deduplication using flexible text matching and cleaning in pandas dataframe
Stars: ✭ 20 (-50%)
Mutual labels:  pandas
Python stock github
Python 量化投资及 Github 管理学习笔记
Stars: ✭ 39 (-2.5%)
Mutual labels:  pandas
Machinelearningcourse
A collection of notebooks of my Machine Learning class written in python 3
Stars: ✭ 35 (-12.5%)
Mutual labels:  pandas
Machine Learning Alpine
Alpine Container for Machine Learning
Stars: ✭ 30 (-25%)
Mutual labels:  pandas
Pythondatasciencehandbook
The book was written and tested with Python 3.5, though other Python versions (including Python 2.7) should work in nearly all cases.
Stars: ✭ 31,995 (+79887.5%)
Mutual labels:  pandas
Pandas basics
basic pandas tutorials
Stars: ✭ 34 (-15%)
Mutual labels:  pandas
Pandas Validation
A small Python library for validating data with pandas
Stars: ✭ 20 (-50%)
Mutual labels:  pandas
Pandas Ta
Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ Indicators
Stars: ✭ 962 (+2305%)
Mutual labels:  pandas
Crime Analysis
Association Rule Mining from Spatial Data for Crime Analysis
Stars: ✭ 20 (-50%)
Mutual labels:  pandas
Place2live
Analysis of the characteristics of different countries
Stars: ✭ 30 (-25%)
Mutual labels:  pandas
Mlcourse.ai
Open Machine Learning Course
Stars: ✭ 7,963 (+19807.5%)
Mutual labels:  pandas
Deep Hedging
Deep Hedging Demo - An Example of Using Machine Learning for Derivative Pricing.
Stars: ✭ 30 (-25%)
Mutual labels:  quantitative-finance

Pandas Machine Learning and Quant Finance Library Collection

Python 3.8 NOX Tests Status Spelling

Whether it is some statistical analysis or machine learning, most likely it all starts with a DataFrame. But soon enough you will find yourself converting your data frames to numpy, splitting arrays, applying min max scalers, lagging and concatenating columns etc. As a result your notebook looks messy and became and unreadable beast. Yet the mess becomes only worse once you start to deploy your research into a productive application. Now the untested hard coded data pipelines need to be maintained at two places.

The aim of this library is to conveniently operate with data frames without and abstract away the ugly unreproducible data pipelines. The only thing you need is the original unprocessed data frame where you started.

Fitting Example You find this demo in the pytorch examples

The data pipeline becomes a part of your model and gets saved that way. Going into production is as easy as this:

import pandas as pd
import pandas_ml_utils  # monkey patch the `DataFrame`
from pandas_ml_utils import Model
# alternatively as a one liner `from pandas_ml_utils import pd, Model` 

model = Model.load('your_saved.model')
df = pd.read_csv('your_raw_data.csv')
df_prediction = df.model.predict(model)

# do something with your prediction
df_prediction.plot()

Project Structure

The project is divided into several sub modules where each module could have its own life-cycle. It is definitely an option to move the modules into their own repository in the future if there will be dedicated contributors.

The submodules are:

  • pandas-ml-1ntegration-test more complex tests involving several modules and eventually external data
  • pandas-ml-airflow a very experimental module to integrate models within apache airflow
  • pandas-ml-common functionalities around data access and preparation like train/test splitting, cross validation, ...
  • pandas-ml-quant enhancing pandas-ml-utils for modeling financial timeseries
  • pandas-ml-quant-rl very experimental module for reinforcement learning
  • pandas-ml-utils core module to train models directly from a pandas data frame
  • pandas-ml-utils-keras deprecated module, might be revoked using tensorflow probability
  • pandas-ml-utils-torch pytorch module for machine learning
  • pandas-quant-data-provider easy wrapper around data providers like yahoo and investpy
  • pandas-ta-quant technical analysis functionality like TA-Lib
  • pandas-ta-quant-plot plotting library to simulate state of the art financial plots (also very early stage)

pandas-ml-common

This module contains helpers and utilities for the most common tasks like:

  • splitting data and generation of cross validation data sets
  • nesting and unnesting of multi dimensional column data like images or geodata
  • helpers for pandas MultiIndexes
  • dependency injection
  • data serialization

pandas-ml-utils

The main abstraction layer for data selection, preparation and modelling. The core object is the FeaturesAndLabels definition. Very high level your models will look something along the lines:

from pandas_ml_utils import pd

df = pd.DataFrame({})
with df.model('file_name') as m:
    # use a context manager and import all your dependencies locally 
    # and create all objects needed for your model
    # this makes sure when you save (pickle) your model that it can load conveniently without polluting
    # your global name space   
    from pandas_ml_utils import SkModel, FeaturesAndLabels, FittingParameter, RegressionSummary, naive_splitter
    from sklearn.neural_network import MLPRegressor

    fit = m.fit(
        SkModel(
            MLPRegressor(activation='tanh', hidden_layer_sizes=(60, 50), random_state=42, max_iter=2),
            FeaturesAndLabels(
                features=[
                    "some_column",
                    lambda df: df["some_column"].apply(lambda x: "some calculation"),
                ],
                labels=[
                    lambda df: df["some_column"].apply(lambda x: "some calculation")
                ]
            ),
            summary_provider=RegressionSummary
        ),
        FittingParameter(naive_splitter())
    )

 
fit  # finally just return fit as the `Fit` object implements `_repr_html_()` which renders a nice report

Before a model can be developed, features need to be selected.

df.model.feature_selection(
    FeaturesAndLabels(
        features=[...],
        labels=[...]
    )
)

Check this demo from the examples:

Classification Example

pandas-ml-utils-torch

Extends the pandas-ml-utils library for the use of pytorch models

pandas-ml-utils-keras

Extends the pandas-ml-utils library for the use of keras tensorflow 1.x models.

NOTE! This module is currently stalled as I mainly use pytorch at the moment.

pandas-ml-quant

...

pandas-ta-quant

Technical analysis library Ta Plot

pandas-ta-quant-plot

Charting library

Ta Plot

pandas-ml-quant-data-provider

This is mainly a wrapper around data providing libraries yfinance or investing

Testing and experiments

There are some more not published libraries used for testing and experiments.

Installation

Currently, all libraries are somewhat entangled and will hike parallel the releases cycles. This dependency will weaken up as we reach more stable release.

pip install pandas-ml-common pandas-ml-utils pandas-ta-quant pandas-ml-quant \
pandas-quant-data-provider pandas-ta-quant-plot
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].