Skip to content

Commit

Permalink
Fixed errors related to failing python examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 3, 2012
1 parent d01d587 commit 06d9542
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Expand Up @@ -12,6 +12,7 @@ def converter_kernellocaltangentspacealignment_modular(data,k):
features = RealFeatures(data)

converter = KernelLocalTangentSpaceAlignment()
converter.set_nullspace_shift(-1e-3)
converter.set_target_dim(1)
converter.set_k(k)
converter.apply(features)
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/features/SparseFeatures.cpp
Expand Up @@ -758,7 +758,8 @@ template<class ST> CRegressionLabels* CSparseFeatures<ST>::load_svmlight_file(ch

lab=new CRegressionLabels(num_vectors);
sparse_feature_matrix=SG_MALLOC(SGSparseVector<ST>, num_vectors);

for (int32_t i=0; i<num_vectors; i++)
new (&sparse_feature_matrix[i]) SGSparseVector<ST>();
rewind(f);
sz=blocksize;
int32_t lines=0;
Expand Down
1 change: 1 addition & 0 deletions src/shogun/io/BinaryFile.cpp
Expand Up @@ -142,6 +142,7 @@ void CBinaryFile::fname(SGSparseVector<sg_type>*& matrix, int32_t& num_feat, int
\
for (int32_t i=0; i<num_vec; i++) \
{ \
new (&matrix[i]) SGSparseVector<sg_type>(); \
int32_t len=0; \
if (fread(&len, sizeof(int32_t), 1, file)!=1) \
SG_ERROR("Failed to read sparse vector length of vector idx=%d\n", i); \
Expand Down

0 comments on commit 06d9542

Please sign in to comment.