optiver-realized-volatility-prediction's People
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.