Skip to content

Commit cc0bb2d

Browse files
committed
Merge branch 'release/6.1.1'
2 parents ccea5a2 + e26f160 commit cc0bb2d

File tree

11 files changed

+57
-43
lines changed

11 files changed

+57
-43
lines changed

NEWS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017-11-28 Viktor Gal <[email protected]>
2+
3+
* SHOGUN Release version 6.1.1 (libshogun 18.0, data 0.11, parameter 1)
4+
5+
* Bugfixes:
6+
- Install headers of GPL models when LICENSE_GPL_SHOGUN is enabled [Viktor Gal]
7+
- Always turn on LIBSHOGUN_BUILD_STATIC when compiling with MSVC [Viktor Gal]
8+
- Fix ipython notebook errors [Viktor Gal]
9+
110
2017-11-28 Viktor Gal <[email protected]>
211

312
* SHOGUN Release version 6.1.0 (libshogun 18.0, data 0.11, parameter 1)

doc/ipython-notebooks/clustering/KMeans.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@
669669
"from numpy import ones, zeros\n",
670670
"\n",
671671
"# first 50 are iris sensosa labelled 0, next 50 are iris versicolour labelled 1 and so on\n",
672-
"labels = concatenate((zeros(50),ones(50),2.*ones(50)),1)\n",
672+
"labels = concatenate((zeros(50),ones(50),2.*ones(50)),0)\n",
673673
"\n",
674674
"# bind labels assigned to Shogun multiclass labels\n",
675675
"ground_truth = MulticlassLabels(array(labels,dtype='float64'))"

doc/ipython-notebooks/distributions/KernelDensity.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
"\n",
8383
"# generates samples from the distribution\n",
8484
"def generate_samples(n_samples,mu1,sigma1,mu2,sigma2):\n",
85-
" samples1 = np.random.normal(mu1,sigma1,(1,n_samples/2.0))\n",
86-
" samples2 = np.random.normal(mu2,sigma2,(1,n_samples/2.0))\n",
85+
" samples1 = np.random.normal(mu1,sigma1,(1,n_samples/2))\n",
86+
" samples2 = np.random.normal(mu2,sigma2,(1,n_samples/2))\n",
8787
" samples = np.concatenate((samples1,samples2),1)\n",
8888
" return samples\n",
8989
"\n",

doc/ipython-notebooks/evaluation/xval_modelselection.ipynb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
"result=CrossValidationResult.obtain_from_generic(result)\n",
331331
"\n",
332332
"# this class contains a field \"mean\" which contain the mean performance metric\n",
333-
"print \"Testing\", metric.get_name(), result.mean"
333+
"print \"Testing\", metric.get_name(), result.get_mean()"
334334
]
335335
},
336336
{
@@ -350,7 +350,7 @@
350350
},
351351
"outputs": [],
352352
"source": [
353-
"print \"Testing\", metric.get_name(), [CrossValidationResult.obtain_from_generic(cross.evaluate()).mean for _ in range(10)]"
353+
"print \"Testing\", metric.get_name(), [CrossValidationResult.obtain_from_generic(cross.evaluate()).get_mean() for _ in range(10)]"
354354
]
355355
},
356356
{
@@ -377,7 +377,7 @@
377377
"result=CrossValidationResult.obtain_from_generic(result)\n",
378378
"\n",
379379
"print \"Testing cross-validation mean %.2f \" \\\n",
380-
"% (result.mean)"
380+
"% (result.get_mean())"
381381
]
382382
},
383383
{
@@ -401,7 +401,7 @@
401401
"for i in range(len(results)):\n",
402402
" kernel.set_width(widths[i])\n",
403403
" result=CrossValidationResult.obtain_from_generic(cross.evaluate())\n",
404-
" results[i]=result.mean\n",
404+
" results[i]=result.get_mean()\n",
405405
" \n",
406406
"plot(log2(widths), results, 'blue')\n",
407407
"xlabel(\"log2 Kernel width\")\n",
@@ -413,10 +413,10 @@
413413
"# compare this with a linear kernel\n",
414414
"classifier.set_kernel(LinearKernel())\n",
415415
"lin_k=CrossValidationResult.obtain_from_generic(cross.evaluate())\n",
416-
"plot([log2(widths[0]), log2(widths[len(widths)-1])], [lin_k.mean,lin_k.mean], 'r')\n",
416+
"plot([log2(widths[0]), log2(widths[len(widths)-1])], [lin_k.get_mean(),lin_k.get_mean()], 'r')\n",
417417
"\n",
418418
"# please excuse this horrible code :)\n",
419-
"print \"Linear kernel gives\", lin_k.mean\n",
419+
"print \"Linear kernel gives\", lin_k.get_mean()\n",
420420
"\n",
421421
"_=legend([\"Gaussian\", \"Linear\"], loc=\"lower center\")"
422422
]
@@ -505,7 +505,7 @@
505505
" result=cross.evaluate()\n",
506506
" result=CrossValidationResult.obtain_from_generic(result)\n",
507507
" #Enlist mean error for all runs\n",
508-
" errors.append(result.mean)\n",
508+
" errors.append(result.get_mean())\n",
509509
"\n",
510510
"figure(figsize=(20,6))\n",
511511
"suptitle(\"Finding best (tau) parameter using cross-validation\", fontsize=12)\n",
@@ -525,8 +525,8 @@
525525
" krr.set_tau(tau)\n",
526526
" result=cross.evaluate()\n",
527527
" result=CrossValidationResult.obtain_from_generic(result)\n",
528-
" #print tau, \"error\", result.mean\n",
529-
" errors.append(result.mean)\n",
528+
" #print tau, \"error\", result.get_mean()\n",
529+
" errors.append(result.get_mean())\n",
530530
"\n",
531531
"p2=subplot(122)\n",
532532
"title(\"Kernel Ridge regression\")\n",
@@ -564,8 +564,8 @@
564564
" kernel.set_width(width)\n",
565565
" result=cross.evaluate()\n",
566566
" result=CrossValidationResult.obtain_from_generic(result)\n",
567-
" #print width, \"error\", result.mean\n",
568-
" errors.append(result.mean)\n",
567+
" #print width, \"error\", result.get_mean()\n",
568+
" errors.append(result.get_mean())\n",
569569
" \n",
570570
"figure(figsize=(15,5))\n",
571571
"p=subplot(121)\n",
@@ -608,7 +608,7 @@
608608
" kernel.set_width(grid[:,i][1])\n",
609609
" result=cross.evaluate()\n",
610610
" result=CrossValidationResult.obtain_from_generic(result)\n",
611-
" errors.append(result.mean)\n",
611+
" errors.append(result.get_mean())\n",
612612
"errors=array(errors).reshape((n, n))\n"
613613
]
614614
},
@@ -670,7 +670,7 @@
670670
" result=cross.evaluate()\n",
671671
" result=CrossValidationResult.obtain_from_generic(result)\n",
672672
" print \"-\"*80\n",
673-
" print \"|\", \"%30s\" % machine.get_name(),\"|\", \"%20s\" %metric.get_name(),\"|\",\"%20s\" %result.mean ,\"|\" \n",
673+
" print \"|\", \"%30s\" % machine.get_name(),\"|\", \"%20s\" %metric.get_name(),\"|\",\"%20s\" %result.get_mean() ,\"|\" \n",
674674
"print \"-\"*80"
675675
]
676676
},
@@ -779,7 +779,7 @@
779779
"result=cross_validation.evaluate()\n",
780780
"result=CrossValidationResult.obtain_from_generic(result)\n",
781781
"\n",
782-
"print 'Error with Best parameters:', result.mean"
782+
"print 'Error with Best parameters:', result.get_mean()"
783783
]
784784
},
785785
{

doc/ipython-notebooks/gaussian_process/gaussian_processes.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@
10041004
"# inducing features (here: a random grid over the input space, try out others)\n",
10051005
"n_inducing=10\n",
10061006
"#X_inducing=linspace(X_train.min(), X_train.max(), n_inducing)\n",
1007-
"X_inducing=np.random.rand(X_train.min()+n_inducing)*X_train.max()\n",
1007+
"X_inducing=np.random.rand(int(X_train.min())+n_inducing)*X_train.max()\n",
10081008
"feats_inducing=RealFeatures(X_inducing.reshape(1,len(X_inducing)))\n",
10091009
"\n",
10101010
"# create FITC inference method and GP instance\n",

doc/ipython-notebooks/ica/bss_audio.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"\n",
6666
" # re-interpolate samplerate \n",
6767
" ratio = float(samplerate) / float(rate)\n",
68-
" data = resample(data, len(data) * ratio)\n",
68+
" data = resample(data, int(len(data) * ratio))\n",
6969
" \n",
7070
" return samplerate, data.astype(np.int16)"
7171
],
@@ -317,7 +317,7 @@
317317
"cell_type": "code",
318318
"collapsed": false,
319319
"input": [
320-
"from shogun.Features import RealFeatures\n",
320+
"from shogun import RealFeatures\n",
321321
"\n",
322322
"# Convert to features for shogun\n",
323323
"mixed_signals = RealFeatures((X).astype(np.float64))"
@@ -343,7 +343,7 @@
343343
"cell_type": "code",
344344
"collapsed": false,
345345
"input": [
346-
"from shogun.Converter import Jade\n",
346+
"from shogun import Jade\n",
347347
"\n",
348348
"# Separating with JADE\n",
349349
"jade = Jade()\n",

doc/ipython-notebooks/ica/ecg_sep.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"cell_type": "code",
158158
"collapsed": false,
159159
"input": [
160-
"from shogun.Features import RealFeatures\n",
160+
"from shogun import RealFeatures\n",
161161
"\n",
162162
"# Signal Matrix X\n",
163163
"X = (np.c_[abdominal2, abdominal3, abdominal4, abdominal5, abdominal6, thoracic7,thoracic8,thoracic9]).T\n",
@@ -180,7 +180,7 @@
180180
"cell_type": "code",
181181
"collapsed": false,
182182
"input": [
183-
"from shogun.Converter import SOBI\n",
183+
"from shogun import SOBI\n",
184184
"\n",
185185
"# Separating with SOBI\n",
186186
"sep = SOBI()\n",

doc/ipython-notebooks/metric/LMNN.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@
584584
"# perform cross-validation and print the result!\n",
585585
"result = cross_validation.evaluate()\n",
586586
"result = CrossValidationResult.obtain_from_generic(result)\n",
587-
"print('kNN mean accuracy in a total of %d runs is %.4f.' % (num_runs, result.mean))"
587+
"print('kNN mean accuracy in a total of %d runs is %.4f.' % (num_runs, result.get_mean()))"
588588
],
589589
"language": "python",
590590
"metadata": {},
@@ -756,9 +756,9 @@
756756
"\n",
757757
"result = CrossValidationResult.obtain_from_generic(cross_validation.evaluate())\n",
758758
"euclidean_means = numpy.zeros(3)\n",
759-
"euclidean_means[0] = result.mean\n",
759+
"euclidean_means[0] = result.get_mean()\n",
760760
"\n",
761-
"print('kNN accuracy with the Euclidean distance %.4f.' % result.mean)"
761+
"print('kNN accuracy with the Euclidean distance %.4f.' % result.get_mean())"
762762
],
763763
"language": "python",
764764
"metadata": {},
@@ -787,9 +787,9 @@
787787
"\n",
788788
"result = CrossValidationResult.obtain_from_generic(cross_validation.evaluate())\n",
789789
"lmnn_means = numpy.zeros(3)\n",
790-
"lmnn_means[0] = result.mean\n",
790+
"lmnn_means[0] = result.get_mean()\n",
791791
"\n",
792-
"print('kNN accuracy with the distance obtained by LMNN %.4f.' % result.mean)"
792+
"print('kNN accuracy with the distance obtained by LMNN %.4f.' % result.get_mean())"
793793
],
794794
"language": "python",
795795
"metadata": {},
@@ -852,17 +852,17 @@
852852
"# perform kNN classification after the feature rescaling\n",
853853
"knn.set_distance(EuclideanDistance())\n",
854854
"result = CrossValidationResult.obtain_from_generic(cross_validation.evaluate())\n",
855-
"euclidean_means[1] = result.mean\n",
855+
"euclidean_means[1] = result.get_mean()\n",
856856
"\n",
857-
"print('kNN accuracy with the Euclidean distance after feature rescaling %.4f.' % result.mean)\n",
857+
"print('kNN accuracy with the Euclidean distance after feature rescaling %.4f.' % result.get_mean())\n",
858858
"\n",
859859
"# train kNN in the new features and classify with kNN\n",
860860
"lmnn.train()\n",
861861
"knn.set_distance(lmnn.get_distance())\n",
862862
"result = CrossValidationResult.obtain_from_generic(cross_validation.evaluate())\n",
863-
"lmnn_means[1] = result.mean\n",
863+
"lmnn_means[1] = result.get_mean()\n",
864864
"\n",
865-
"print('kNN accuracy with the distance obtained by LMNN after feature rescaling %.4f.' % result.mean)"
865+
"print('kNN accuracy with the distance obtained by LMNN after feature rescaling %.4f.' % result.get_mean())"
866866
],
867867
"language": "python",
868868
"metadata": {},
@@ -937,17 +937,17 @@
937937
"# perform kNN classification after whitening\n",
938938
"knn.set_distance(EuclideanDistance())\n",
939939
"result = CrossValidationResult.obtain_from_generic(cross_validation.evaluate())\n",
940-
"euclidean_means[2] = result.mean\n",
940+
"euclidean_means[2] = result.get_mean()\n",
941941
"\n",
942-
"print('kNN accuracy with the Euclidean distance after whitening %.4f.' % result.mean)\n",
942+
"print('kNN accuracy with the Euclidean distance after whitening %.4f.' % result.get_mean())\n",
943943
"\n",
944944
"# train kNN in the new features and classify with kNN\n",
945945
"lmnn.train()\n",
946946
"knn.set_distance(lmnn.get_distance())\n",
947947
"result = CrossValidationResult.obtain_from_generic(cross_validation.evaluate())\n",
948-
"lmnn_means[2] = result.mean\n",
948+
"lmnn_means[2] = result.get_mean()\n",
949949
"\n",
950-
"print('kNN accuracy with the distance obtained by LMNN after whitening %.4f.' % result.mean)"
950+
"print('kNN accuracy with the distance obtained by LMNN after whitening %.4f.' % result.get_mean())"
951951
],
952952
"language": "python",
953953
"metadata": {},

doc/ipython-notebooks/multiclass/Tree/DecisionTrees.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@
15921592
"result = cross_val.evaluate()\n",
15931593
"\n",
15941594
"# print result\n",
1595-
"print('Mean Accuracy : ' + str(CrossValidationResult.obtain_from_generic(result).mean))"
1595+
"print('Mean Accuracy : ' + str(CrossValidationResult.obtain_from_generic(result).get_mean()))"
15961596
]
15971597
},
15981598
{
@@ -1700,7 +1700,7 @@
17001700
" cross_val.set_num_runs(10)\n",
17011701
"\n",
17021702
" # return cross validation result\n",
1703-
" return CrossValidationResult.obtain_from_generic(cross_val.evaluate()).mean"
1703+
" return CrossValidationResult.obtain_from_generic(cross_val.evaluate()).get_mean()"
17041704
]
17051705
},
17061706
{
@@ -2073,7 +2073,7 @@
20732073
"# run cross-validation multiple times\n",
20742074
"cross_val.set_num_runs(10)\n",
20752075
"\n",
2076-
"print('Mean classification accuracy : '+str(CrossValidationResult.obtain_from_generic(cross_val.evaluate()).mean*100)+' %')"
2076+
"print('Mean classification accuracy : '+str(CrossValidationResult.obtain_from_generic(cross_val.evaluate()).get_mean()*100)+' %')"
20772077
]
20782078
},
20792079
{
@@ -2163,7 +2163,7 @@
21632163
" cross_val.set_num_runs(3)\n",
21642164
"\n",
21652165
" # return cross validation result\n",
2166-
" return CrossValidationResult.obtain_from_generic(cross_val.evaluate()).mean"
2166+
" return CrossValidationResult.obtain_from_generic(cross_val.evaluate()).get_mean()"
21672167
]
21682168
},
21692169
{

doc/ipython-notebooks/regression/Regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@
375375
" cross_validation.set_num_runs(100)\n",
376376
" result = cross_validation.evaluate()\n",
377377
" result = CrossValidationResult.obtain_from_generic(result)\n",
378-
" errors.append(result.mean)\n",
378+
" errors.append(result.get_mean())\n",
379379
" return errors"
380380
]
381381
},

src/shogun/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ OPTION(DISABLE_SSE "Disable SSE and SSE2 features.")
2424
set(INCLUDE_INSTALL_DIR include)
2525
set(THIRD_PARTY_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib/external)
2626

27-
if (MSVC AND (BUILD_EXAMPLES OR BUILD_META_EXAMPLES))
27+
if (MSVC)
2828
SET(LIBSHOGUN_BUILD_STATIC ON
2929
CACHE BOOL "Build libshogun static library" FORCE)
3030
endif()
@@ -488,8 +488,13 @@ ENDIF()
488488

489489
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/lib/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/lib/config.h @ONLY)
490490

491+
LIST(APPEND INCLUDE_HEADERS_DIR_LIST ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
492+
IF (LICENSE_GPL_SHOGUN)
493+
LIST(APPEND INCLUDE_HEADERS_DIR_LIST ${SHOGUN_GPL_INCLUDE_DIR}/shogun)
494+
ENDIF()
495+
491496
INSTALL(
492-
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
497+
DIRECTORY ${INCLUDE_HEADERS_DIR_LIST}
493498
DESTINATION ${INCLUDE_INSTALL_DIR}
494499
COMPONENT headers
495500
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"

0 commit comments

Comments
 (0)