Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shogun::CFeatures* simple_generate_features(int dim_features, int num_vec) {
- shogun::SGMatrix<float64_t> M(dim_features, num_vec);
- for (int i = 0; i< dim_features; ++i) {
- for (int j = 0; j< num_vec; ++j) {
- M(i,j) = (std::pow(j + 0.0, 1.3) + i + j)/10;
- }
- }
- ShowshogunMatrix( M);
- return new shogun::CDenseFeatures<float64_t>(M);
- }
- void test_kernel() {
- shogun::CKernel* kernel = new CGaussianKernel();
- CFeatures* p_features = simple_generate_features(5,11);
- CFeatures* p_features1 = simple_generate_features(5,11);
- kernel->init(p_features, p_features1);
- kernel->cleanup();
- kernel->init(p_features, p_features1);
- kernel->cleanup();
- }
- int main() {
- init_shogun_with_defaults();
- //testpackage();
- CFeatures* p_features = simple_generate_features(5,11);
- //test_tapkee_kpca(p_features);
- std::cout<<"======================="<<std::endl;
- //display_CDenseFeatures((CDenseFeatures<float64_t>*)p_features);
- // testKPCA(p_features);
- test_kernel();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement