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

self.m_ is approximately equal to zero. #15

Open
energylulu opened this issue Oct 18, 2018 · 1 comment
Open

self.m_ is approximately equal to zero. #15

energylulu opened this issue Oct 18, 2018 · 1 comment

Comments

@energylulu
Copy link

Hi, when I trained a model using the codes:

"clf = RVR(kernel = 'rbf',n_iter=300,alpha=1e-3,beta=1.e-3,threshold_alpha=1e3)
clf.fit(input_train, output_train)
output_2_rvr = clf.predict(input_test)"

input_train is a 40003 matrix, output_train is a 40001 matrix.

error:
"
D:\ProgramData\Anaconda3\lib\site-packages\skrvm\rvm.py:153: RuntimeWarning: divide by zero encountered in true_divide
self.alpha_ = self.gamma/(self.m_ ** 2)
D:\ProgramData\Anaconda3\lib\site-packages\skrvm\rvm.py:152: RuntimeWarning: invalid value encountered in multiply
self.gamma = 1 - self.alpha_*np.diag(self.sigma_)
D:\ProgramData\Anaconda3\lib\site-packages\skrvm\rvm.py:153: RuntimeWarning: invalid value encountered in true_divide
self.alpha_ = self.gamma/(self.m_ ** 2)
D:\ProgramData\Anaconda3\lib\site-packages\skrvm\rvm.py:108: RuntimeWarning: invalid value encountered in less
keep_alpha = self.alpha_ < self.threshold_alpha
1
2
Traceback (most recent call last):
File "E:\python_work\pitch_system\src\relevance_vector_machine\rvr_train_test1.py", line 50, in
mse_rvr = mean_squared_error(output_2_rvr, output_test)
File "D:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\regression.py", line 238, in mean_squared_error
y_true, y_pred, multioutput)
File "D:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\regression.py", line 76, in _check_reg_targets
y_true = check_array(y_true, ensure_2d=False)
File "D:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 453, in check_array
_assert_all_finite(array)
File "D:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 44, in _assert_all_finite
" or a value too large for %r." % X.dtype)
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
"

How can I deal with it ? Thank you very much!

@energylulu
Copy link
Author

input_train is a 4000 ,3 matrix, output_train is a 4000,1 matrix.

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

No branches or pull requests

1 participant