Nicolas Cedilnik
2016-04-21 11:32:12 UTC
Hi all,
I'm trying to use scikit-learn to do SV regression and this small data
set causes it to crash every time. I can't even stop the process with
CTRL+C and have to kill the process some other way. I've tested it on
python 3.5 and 2.7.
Am I doing something wrong or should I report a bug?
Here's some copy-pastable code to reproduce the issue:
from sklearn.svm import SVR
import numpy as np
X=np.array([[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ]])
y=np.array([ 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2,
0.3,
0.3, 0.3, 0.3, 0.3, 0.4, 0.4, 0.4, 0.4, 0.4, 0.5, 0.5,
0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.6, 0.6, 0.7, 0.7, 0.7,
0.7, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8, 0.9, 0.9, 0.9, 0.9,
0.9])
weights=np.array([ 1. , 0.75 , 1. , 0.88867188,
0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391],
dtype=np.float16)
svr_poly = SVR(kernel='poly', C=1e3, degree=2)
fit = svr_poly.fit(X, y, weights)
-- Nicolas Cedilnik
PS: this is not the 'real' data I need the regression on.
I'm trying to use scikit-learn to do SV regression and this small data
set causes it to crash every time. I can't even stop the process with
CTRL+C and have to kill the process some other way. I've tested it on
python 3.5 and 2.7.
Am I doing something wrong or should I report a bug?
Here's some copy-pastable code to reproduce the issue:
from sklearn.svm import SVR
import numpy as np
X=np.array([[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ],
[ 40.8 ],
[ 21327.5900838],
[ 28781.2890295],
[ 29978.2941176],
[ 30732.562406 ]])
y=np.array([ 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2,
0.3,
0.3, 0.3, 0.3, 0.3, 0.4, 0.4, 0.4, 0.4, 0.4, 0.5, 0.5,
0.5, 0.5, 0.5, 0.6, 0.6, 0.6, 0.6, 0.6, 0.7, 0.7, 0.7,
0.7, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8, 0.9, 0.9, 0.9, 0.9,
0.9])
weights=np.array([ 1. , 0.75 , 1. , 0.88867188,
0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391,
1. , 0.75 , 1. , 0.88867188, 0.66650391],
dtype=np.float16)
svr_poly = SVR(kernel='poly', C=1e3, degree=2)
fit = svr_poly.fit(X, y, weights)
-- Nicolas Cedilnik
PS: this is not the 'real' data I need the regression on.