Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanglespace/hotstepper
A Numpy based step function library for analysis and profit. More than just taking you up and down.
https://github.com/tanglespace/hotstepper
data-analysis kernel-methods linear-algebra numpy pandas step-functions time-series
Last synced: 3 months ago
JSON representation
A Numpy based step function library for analysis and profit. More than just taking you up and down.
- Host: GitHub
- URL: https://github.com/tanglespace/hotstepper
- Owner: TangleSpace
- License: mit
- Created: 2021-02-11T23:55:28.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-21T18:33:22.000Z (almost 4 years ago)
- Last Synced: 2024-10-11T09:33:21.270Z (3 months ago)
- Topics: data-analysis, kernel-methods, linear-algebra, numpy, pandas, step-functions, time-series
- Language: Python
- Homepage:
- Size: 304 MB
- Stars: 15
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The Hot Stepper library is for exploring datasets via step function expansions.
It's all about tools that just work and no need for extensive knowledge of Pandas or Numpy or whatever, just HotStepper!. Albeit, knowledge of Pandas and Numpy is useful.
## Installation
HotStepper can be installed from PyPI:```bash
pip install hotstepper
```Conda install coming soon!
## Quick Test Drive
## Introducing Sequency Analysis!
A very exciting (atleast to me) new addition to HotStepper, the ability to perform Fourier like transforms and analysis, using dedicated basis functions that are directly suited to step functions and step data, (Walsh functions!). Have a look at the Sequency Analysis Quickstart, for a taste of more analysis power to come.## Documentation
Everything (mostly) you want to know about HotStepper and making use in your workflow is here [Read the Docs](https://hotstepper.readthedocs.io/)## Sample Data Repository
Sample data is located here: hotstepper-data.
I'd like to thank the Staircase package owner for currating some of these datasets, thanks Riley!## Step Functions
Behold! the power of the [Heaviside step function](https://en.wikipedia.org/wiki/Heaviside_step_function)
Checkout a detailed, somewhat, probably very exciting, non-stop adventure ride through some of the, umm, math.....behind HotStepper and step functions. With any luck, someone will have a deadline tomorrow and HotStepper and step functions will save the day! Or atleast, I like to keep thinking that.### Ok, don't packup just yet.
What the f*&^ is a step function you may ask? Have you ever seen some stairs?, this is an equal oppotunity package, so you may be in a wheel chair and unable to use stairs in the typical way, so just having seen some stairs will suffix.
Instead of providing a strict mathematical definition that we can all wank off about, how bout just some simple comparisons to warm us up? If you still need to have a wank, feel free to step out (pun intended) anytime.
What is a function? ok, how about just some data we could plot? let's go home school, say we have a vector...oh f&^%, what is that? ok ok, how about just a list of numbers, say y = (1, 1, 2, 3, 5, 8, 13, 21), to keep the wanking impulse alive, we could say that this is a discrete function where we can index the values from left to right with an integer, for example , so that we could do something fancy like y(6) = 8.
Alright, if we just plot y(n) with straight lines connecting the points, we'd get something like,
```python
import matplotlib.pyplot as plt
def fibo_sequence(n):
f0 = 0
fn = 1for _ in range(n):
yield fn
f0, fn = fn, f0 + fnsequence_length = 8
x = np.arange(0,8,1,dtype=int)
y = np.array(list(fibo_sequence(sequence_length)),dtype=int)fig,ax = plt.subplots()
ax.plot(x,y)
```Now what if we only start with the rules of the fibonacci sequence, we can generate a step sequence directly.
```python
import matplotlib.pyplot as plt
from hotstepper import Step, Stepsdef fibo_step_sequence(n):
f0 = 0
fn = 1for i in range(n):
yield Step(start=i+1,weight=(fn - f0))
f0, fn = fn, f0 + fnsequence_length = 8
st = Steps().add([f for f in fibo_step_sequence(sequence_length)])ax = st.plot(method='pretty')
st.smooth_plot(color='g',ax=ax,smooth_factor=0.3)
plt.setp(ax, title='Fibo Steps and Components',xlabel='Index', ylabel='Steps Value')#Our steps object contains individual step functions, we can iterate over these directly, nice!
for s in st:
s.plot(ax=ax)
s.smooth_plot(ax=ax,linestyle='-.',color='g')
```A very quick taste of the power that can be tapped with HotStepper. Let's say you have a data set as check-in and check-out times for a hotel. If we need to understand how many people are present in the hotel at any point in time and, as a sample of how HotStepper can help speed your analysis, we can get a quick summary of the dataset with a single line of code.
```python
import hotstepper.samples as samples#Typical work flow, get the data
hotel_stays = samples.hotel_stays_sample()#Explore the data
hotel_stays.summary()```
## Acknowledgments
This project is was inspired by the [Staircase Package](https://github.com/venaturum/staircase), whilst the use cases are similar, HotStepper and Staircase represent different approaches and each provides pros and cons over the other.