Comments (7)
Thank you @klingsly for the reporting the issue. I will respond to you shortly, with a solution/code.
from kernelmethods.
Thank you @klingsly for the reporting the issue. I will respond to you shortly, with a solution/code.
I am sorry to get back to you late.Your method is very useful to me. I hope you can solve my problem.Looking forward to your reply soon!
from kernelmethods.
Hi @klingsly , sorry for the delayed reply, but here it is:
Applying the kernel functions to test datasets requires an additional step of computing inner products between the test and train sample feature matrices, as illustrated below:
# create same kernel matrices as before
lin = KernelMatrix(LinearKernel())
rbf = KernelMatrix(GaussianKernel(sigma=10))
poly = KernelMatrix(PolyKernel(degree=2))
lap = KernelMatrix(LaplacianKernel(gamma=2))
test_kSet = KernelSet()
for km in [lin, rbf, poly, lap]:
# notice that this is an inner product between test AND train sample feature matrices
# this is required in kernel methods to make predictions
km.attach_to(X_test, name_one='test_X',
sample_two=X_train, name_two='train_X')
test_kSet.append(km)
# compute the weighted linear combination
fused_test_X = linear_combination(test_kSet, weight_vec)
# now make predictions
mkl.predict(fused_test_X)
hope that helps? let me know if you have more questions.
we hope to release a MultipleKernelLearning()
class soon, and would appreciate others contributing to it if they have the necessary skills and time. (see #9 )
from kernelmethods.
Thanks for your response. I have a problem with this solution about how to fit train datasets?
from kernelmethods.
What do you mean? You already did train the MKL with:
mkl.fit(X=X_train, y=y_train)
from kernelmethods.
Sorry, I misunderstood what you meant. It's OK now
from kernelmethods.
Great. please feel free to open another issue if you run into any issues.
from kernelmethods.
Related Issues (6)
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.
from kernelmethods.