Giter Site home page Giter Site logo

optiver-realized-volatility-prediction's People

Contributors

nyanp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

optiver-realized-volatility-prediction's Issues

bug(KNN FIT): Neighbors metric_params expecting 'VI', not 'V'

Hi,

I'm getting this from lightgbm-clustering-model.ipynb

Traceback (most recent call last):
  File "/examples/nyan-optiver/lightgbm-clustering-model.py", line 340, in <module>
    k_neighbors_p1 = Neighbors(pivot, 2, metric='mahalanobis', metric_params={'V':np.cov(pivot.values.T)})
  File "/examples/nyan-optiver/lightgbm-clustering-model.py", line 325, in __init__
    self.distances, self.neighbors = nn.kneighbors(pivot, return_distance=True)
  File "/opt/bitnami/python/lib/python3.10/site-packages/sklearn/neighbors/_base.py", line 752, in kneighbors
    chunked_results = list(
  File "/opt/bitnami/python/lib/python3.10/site-packages/sklearn/metrics/pairwise.py", line 1709, in pairwise_distances_chunked
    params = _precompute_metric_params(X, Y, metric=metric, **kwds)
  File "/opt/bitnami/python/lib/python3.10/site-packages/sklearn/metrics/pairwise.py", line 1551, in _precompute_metric_params
    raise ValueError(
ValueError: The 'VI' parameter is required for the mahalanobis metric when Y is passed.

Comes from your KNN Fit notebook:

k_neighbors_p1 = Neighbors(pivot, 2, metric='mahalanobis', metric_params={'V':np.cov(pivot.values.T)})
...
k_neighbors_size = Neighbors(pivot, 2, metric='mahalanobis', metric_params={'V':np.cov(pivot.values.T)})

Changing these from V -> VI per the error message resolves and runs. Is this supposed to be VI?

python --version
Python 3.10.4
...

pip list | grep 'sci\|sklearn'
scikit-learn             1.0.2
scipy                    1.8.0
sklearn                  0.0

Happy to submit a PR with the change, but wanted to ask first if this is correct.

Also, I've done some refactoring and Dockerizing for our purposes. If you like, I can submit a PR back with a Dockerfile and a docker compose yaml file to make this easier for people to bring up on their own machines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.