Advertisement
Guest User

Untitled

a guest
Apr 7th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.54 KB | None | 0 0
  1. init_shogun
  2. rand('state',0);
  3.  
  4. disp('Sparse Features')
  5.  
  6. A=rand(3,5);
  7. A(A<0.7)=0;
  8. full(A)
  9.  
  10. % sparse representation X of dense matrix A
  11. X = sparse(A)
  12.  
  13. % create sparse shogun features from dense matrix A
  14. a=SparseRealFeatures(A)
  15. a_out = a.get_full_feature_matrix()
  16.  
  17. % create sparse shogun features from sparse matrix X
  18. a.set_sparse_feature_matrix(X)
  19. a_out=a.get_full_feature_matrix()
  20.  
  21. % create sparse shogun features from sparse matrix X
  22. a=SparseRealFeatures(X)
  23. a_out=a.get_full_feature_matrix()
  24.  
  25. z=sparse(a.get_sparse_feature_matrix())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement