C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
This is a C++ analytical library that provides interface and functionality similar to packages/libraries in Python and R. For example, you could compare this to Pandas or R data.frame.<BR> You could slice the data in many different ways. You could join, merge, group-by the data. You could run various statistical, summarization, financial, and ML algorithms on the data. You could add your custom algorithms easily. You could multi-column sort, custom pick and delete the data. And more …<BR> DataFrame also includes a large collection of analytical algorithms in form of visitors. These are from basic stats such as <I>Mean</I>, <I>Std Deviation</I>, <I>Return</I>, … to more involved analysis such as <I>Affinity Propagation</I>, <I>Polynomial Fit</I>, <I>Fast Fourier transform of arbitrary length</I> … including a good collection of trading indicators. You could also easily add your own algorithms.<BR> For basic operations to start you off, see Hello World. For a complete list of features with code samples, see documentation.
I have followed a few <B>principles in this library</B>:<BR>
linked lists
, std::any
, pointer to base
, ..., including virtual functions
unions
, std::variant
, ...garbage in
, garbage out
DateTime<BR> DateTime class included in this library is a very cool and handy object to manipulate date/time with nanosecond precision and multi timezone capability.<BR>
There is a test program dataframe_performance that should give you a sense of how this library performs. As a comparison, there is also a Pandas pandas_performance script that does exactly the same thing.<BR> <I>dataframe_performance.cc</I> uses DataFrame <B>async interface</B> and is compiled with gcc (10.3.0) compiler with -O3 flag. <I>pandas_performance.py</I> is ran with Pandas 1.3.2, Numpy 1.21.2 and Python 3.7 on Xeon E5-2667 v2. What the test program roughly does:<BR>
Result:
$ python3 benckmarks/pandas_performance.py
Starting ... 1629817655
All memory allocations are done. Calculating means ... 1629817883
6.166675403767268e-05, 1.6487168460770107, 0.9999539627671375
1629817894 ... Done
real 5m51.598s
user 3m3.485s
sys 1m26.292s
$ Release/bin/dataframe_performance
Starting ... 1629818332
All memory allocations are done. Calculating means ... 1629818535
1, 1.64873, 1
1629818536 ... Done
real 3m34.241s
user 3m14.250s
sys 0m25.983s
<B>The Interesting Part:</B><BR>
Contributions<BR> License
mkdir [Debug | Release]
cd [Debug | Release]
cmake -DCMAKE_BUILD_TYPE=[Debug | Release] -DHMDF_BENCHMARKS=1 -DHMDF_EXAMPLES=1 -DHMDF_TESTING=1 ..
make
make install
cd [Debug | Release]
make uninstall
DataFrame is available on Conan platform. Add dataframe/[email protected]
to your requires, where x.y.z
is the release version you want to use. Conan will acquire DataFrame, build it from source in your computer, and provide CMake integration support for your projects. See the Conan docs for more information.<BR> Sample conanfile.txt
:
[requires]
dataframe/[email protected]
[generators]
cmake
DataFrame is also available on Microsoft VCPKG platform
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.[bat|sh]
vcpkg(.exe) integrate install
vcpkg(.exe) install DataFrame