zealberth / lssvr Goto Github PK
View Code? Open in Web Editor NEWLeast Squares Support Vector Regression
License: MIT License
Least Squares Support Vector Regression
License: MIT License
In PR #9 for multidimensional output. scipy's lsmr
only accepts b
as a vector, so in this scenario, it raises a ValueError
and it is completely bypassed and the more expensive pinv
is used.
I think this should be addressed. I am thinking of tackling this by using numpy's lstsq that supports 2-dimensional 'b', or the other alternative would be to use lsmr on each slice of 'b'. Something like this:
try:
if len(shape)>1:
z = np.linalg.lstsq(D.T, t, rcond=None)[0]
else:
z = linalg.lsmr(D.T, t)[0]
except:
z = np.linalg.pinv(D).T @ t
or if we stick to lsmr
, something like this:
try:
if len(shape)>1:
z = np.column_stack([linalg.lsmr(D.T, t_slice)[0] for t_slice in t.T])
else:
z = linalg.lsmr(D.T, t)[0]
except:
z = np.linalg.pinv(D).T @ t
Hey, it seems the project isn't available through pip install!
Hello, when I use LSSVR for regression prediction, I will get a multiple regression coefficient equation. How can I get regression coefficients when using your code?
When i use the SVR i get it with the code :svr.coef_
svr = SVR(kernel='linear', coef0=0, C=0.5)
svr.fit(x,y)
svr.coef_
So,how can i get the coef like SVR in your code(LSSVR)? Thank u
Hey! I made some modifications to my fork to allow for multidimensional targets! Could you take some time to review if they are sound? As I don't fully understand the code yet. The commit with the changes is here.
I am particularly interested in the reason behind the .ravel()
on line 57. I don't see the effect of it, as in your implementation t
is a one-dimensional vector.
I am working on a simulation dataset and the results are sound. If you want I could share the use case.
Hello again, I am trying to install this on google colab with poetry but it fails as the project requires 3.8^
. Is there any version difference that makes the package not run on <3.8
?
So, I verified that you do not use any requirements.txt
file or even a pyproject.toml
file.
To make your code more easily reproducible, I thought about contributing to your project adding a setup using poetry. Besides that, using poetry, you can create .whl
files and distribute your package.
To solve this issue, the following points need to be resolved:
pyproject.toml
with the necessary information about dependenciesREADME.md
to show the package building processHai!
I get an issue when i trying to use this packages when i run :
model = LSSVR()
model.fit(X_train, y_train, kernel='linear')
y_hat = model.predict(X_test)
y_hat = model.predict(X_test)
print('LSSVR\nMSE', mean_squared_error(y_test, y_hat))
print('R2 ',model.score(X_test, y_test))
TypeError Traceback (most recent call last)
in
1 model = LSSVR()
----> 2 model.fit(X_train, y_train, kernel='linear')
3 y_hat = model.predict(X_test)
4 y_hat = model.predict(X_test)
5 print('LSSVR\nMSE', mean_squared_error(y_test, y_hat))
TypeError: fit() got an unexpected keyword argument 'kernel'
how can i solve it?
thanks.
Hi there, since this is one of the very few LS-SVM implementations, I thought you might be interested to know that I've recently released a new LS-SVM package called Neo LS-SVM. The idea is that LS-SVMs have a lot of untapped potential, but that they could use a little more love ❤️ now that most of the attention is going to deep learning and gradient-boosted decision trees. Hope it's useful to you!
Great work ! meanwhile I wanna see how LSSVM work in the classifier, the published LSSVR is very convenient, looking forward to LSSVC. ;D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.