Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Freeze][Resume After Silver SQL] Plot user revenues using Streamlit #829

Draft
wants to merge 88 commits into
base: issue610-create-silver-predictions-table
Choose a base branch
from

Conversation

KatunaNorbert
Copy link
Member

Fixes #612.

calina-c and others added 30 commits February 29, 2024 15:20
Fixes #684. New scatterplots are:
- 2d scatterplot of (a) model's prob_up vs (b) predictoor profit.
- 2d scatterplot of (a) model's prob_up vs (b) trader profit.

Also:
- Fix [#707](#707) [Linter bug] Pylint failures in safe_fetch_ohlcv_dydx. Why here: it was causing my CI to fail, and easy to fix
- For [#547](#547) Eth/Weth currency_types: (a) Move tests from test_mathutil.py to new dedicated test module test_currency_types.py. (b) Add support for unary +/- operators (c) Add tests for math operators +, -, *, /, and unary +/-. Why here: because sim_engine uses it
Fixes #708. The key fix is when the trader exits the trading position in the case of `not pred_up`. 

Related change made: removed Eth stuff from sim_engine. Why: this is _sim_ and doesn't deal with blockchain; the Eth stuff was hurting understandability, including my work to solve this ticket
* Add dependency numbers.
* Add dependabot config.
…c var importances (PR #727)

- #722 Improve AI model: In training, balance True vs False classes
- #725 Improve AI model: In training X, weight newest sample 10x. Also, weight youngest n samples lots too
- #723 Improve AI model: calc rel importances of vars #723
* Bump pylint from 3.0.3 to 3.1.0

Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](pylint-dev/pylint@v3.0.3...v3.1.0)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update pytest.yml

* Update pytest.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.21.1 to 0.23.5.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.21.1...v0.23.5)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
* Bump numpy from 1.24.4 to 1.26.4

Bumps [numpy](https://github.com/numpy/numpy) from 1.24.4 to 1.26.4.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](numpy/numpy@v1.24.4...v1.26.4)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Trial run for Python 3.9.

* Update dockerfile.

* Change to Python 3.11.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Calina Cenan <calina@cenan.net>
Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.3.2 to 1.4.1.post1.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](scikit-learn/scikit-learn@1.3.2...1.4.1.post1)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
Bumps [pandas](https://github.com/pandas-dev/pandas) from 2.0.3 to 2.2.1.
- [Release notes](https://github.com/pandas-dev/pandas/releases)
- [Commits](pandas-dev/pandas@v2.0.3...v2.2.1)

---
updated-dependencies:
- dependency-name: pandas
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
* split sim_engine.py into 3 modules: sim_engine.py, sim_plotter.py, sim_state.py. 
* each plot is modularized into its own method
Even cleaner! What I did here: rename axes to the names of the plots themselves. This in turn allowed me to reference axes within the plot, rather than passing it in.
* Refactor currency classes to reduce duplication and enable direct comparisons between Eth and Wei

* Add pos and neg

* Add __float__

* Remove init method

* Formatting

* Fix typo

* amt_wei and amt_eth for compatibility

* Fix return types

* Bug fixes

* Simplify things

* Formatting

* Fix type

* Fix type error

* Revert

* Support numbers

* Fix

* Ensure same type

* Make EthUnit abstract

* Update tests

* Add test_math_with_wei_and_eth test

* Update exception type

* Linter fixes

* Type fixes

* Add test_allowance_update test

* Update test

* Mypy ignore type error

* Formatting

* Fix types

* Fix type

* Fix do_transfer type

* Payout function add types

* Allow comparison with 0

* Add test_compare_to_zero

* Fix types

* Add type

* Fix types and add return type

* Fix type issues in tests

* Fix types

* Fixes

* Remove debug print

* .to_eth().amt_eth

* Reserve order

* More to_eth
Fix #657: [Bug, lake] pl.Dataframe constructor - 'float' object cannot be interpreted as an integer

* Write unit tests that capture the base issue
* Update unit tests to expose orient=infer/col/row behavior. They show: infer can fail sometimes, col always fails, row always passes
* Update DataFrame() constructor calls to always explicitly set orient="row"
…2 most impt vars (#761)

- Plot rel importances of vars #724
- Plot contour if >2 vars, by using 2 most important vars #674
- And refactoring as needed to make ^ clean
* Added several unit tests for the new safe_fetch_ohlcv_dydx() function to make its testing comprehensive
* Fixed a bug in the safe_fetch_ohlcv_dydx() function that was returning an incorrect data structure
dependabot bot and others added 23 commits March 25, 2024 15:10
Bumps [pyarrow](https://github.com/apache/arrow) from 15.0.1 to 15.0.2.
- [Commits](apache/arrow@go/v15.0.1...go/v15.0.2)

---
updated-dependencies:
- dependency-name: pyarrow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.23.5.post1 to 0.23.6.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.23.5.post1...v0.23.6)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [polars](https://github.com/pola-rs/polars) from 0.20.15 to 0.20.16.
- [Release notes](https://github.com/pola-rs/polars/releases)
- [Commits](pola-rs/polars@py-0.20.15...py-0.20.16)

---
updated-dependencies:
- dependency-name: polars
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sim engine now save states as pickles. A streamlit process picks them up and displays real-time and final-state plots based on the data. Instructions have been added to the readme on how to run and display.
Bumps [polars](https://github.com/pola-rs/polars) from 0.20.16 to 0.20.17.
- [Release notes](https://github.com/pola-rs/polars/releases)
- [Commits](pola-rs/polars@py-0.20.16...py-0.20.17)

---
updated-dependencies:
- dependency-name: polars
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [streamlit](https://github.com/streamlit/streamlit) from 1.32.1 to 1.32.2.
- [Release notes](https://github.com/streamlit/streamlit/releases)
- [Commits](streamlit/streamlit@1.32.1...1.32.2)

---
updated-dependencies:
- dependency-name: streamlit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
Bumps [web3](https://github.com/ethereum/web3.py) from 6.15.1 to 6.16.0.
- [Changelog](https://github.com/ethereum/web3.py/blob/v6.16.0/docs/releases.rst)
- [Commits](ethereum/web3.py@v6.15.1...v6.16.0)

---
updated-dependencies:
- dependency-name: web3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [requests-mock](https://github.com/jamielennox/requests-mock) from 1.11.0 to 1.12.1.
- [Release notes](https://github.com/jamielennox/requests-mock/releases)
- [Commits](jamielennox/requests-mock@1.11.0...1.12.1)

---
updated-dependencies:
- dependency-name: requests-mock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
Bumps [ccxt](https://github.com/ccxt/ccxt) from 4.2.82 to 4.2.87.
- [Release notes](https://github.com/ccxt/ccxt/releases)
- [Changelog](https://github.com/ccxt/ccxt/blob/master/CHANGELOG.md)
- [Commits](ccxt/ccxt@4.2.82...4.2.87)

---
updated-dependencies:
- dependency-name: ccxt
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Călina Cenan <calina@cenan.net>
* Fix accuracy calculation for predictions and predictoors info

* fromat new code code
* Readd varimps code and convert to plotly.
* Convert profit and accuracy graphs to plotly.
* Convert profits scatters to plotly.
* Convert f1 recall.
@idiom-bytes idiom-bytes changed the title Plot user revenues using Streamlit [Freeze][Do Not Merge] Plot user revenues using Streamlit Apr 12, 2024
@idiom-bytes idiom-bytes changed the title [Freeze][Do Not Merge] Plot user revenues using Streamlit [Freeze][Rebase After Silver Table] Plot user revenues using Streamlit Apr 12, 2024
@idiom-bytes idiom-bytes changed the title [Freeze][Rebase After Silver Table] Plot user revenues using Streamlit [Freeze][Resume After Silver SQL] Plot user revenues using Streamlit Apr 12, 2024
@idiom-bytes idiom-bytes changed the title [Freeze][Resume After Silver SQL] Plot user revenues using Streamlit [Freeze][Post Silver SQL] Plot user revenues using Streamlit May 6, 2024
@idiom-bytes idiom-bytes changed the title [Freeze][Post Silver SQL] Plot user revenues using Streamlit [Freeze][Resume After Silver SQL] Plot user revenues using Streamlit May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants