Contents:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// comment: strongly typed c++ kind of style here, but doesn't have to be | |
CCSVFile file=CCSVFile("filename"); | |
RealFeatures features=RealFeatures(file); | |
float64 kernel_width=2; | |
GaussianKernel kernel=GaussianKernel(kernel_width); | |
SGMatrix<float64> K=kernel.get_kernel_matrix(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* Written (W) 2012-2014 Heiko Strathmann | |
*/ | |
#include <shogun/base/init.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//g++ -Lbin -Isrc -isystem lib/boost_1.54.0 -isystem lib/eigen_3.2.0 main.cpp -o main -lstan | |
#include <iostream> | |
#include <stan/prob/distributions/univariate/continuous/normal.hpp> | |
#include <stan/prob/distributions/multivariate/continuous/multi_normal.hpp> | |
#include <Eigen/Dense> | |
using namespace std; | |
using namespace Eigen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "Lea" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D <- 50 | |
N <- 4 | |
X <- c(0.0, 0.102040816327, 0.204081632653, 0.30612244898, 0.408163265306, 0.510204081633, 0.612244897959, 0.714285714286, 0.816326530612, 0.918367346939, 1.02040816327, 1.12244897959, 1.22448979592, 1.32653061224, 1.42857142857, 1.5306122449, 1.63265306122, 1.73469387755, 1.83673469388, 1.9387755102, 2.04081632653, 2.14285714286, 2.24489795918, 2.34693877551, 2.44897959184, 2.55102040816, 2.65306122449, 2.75510204082, 2.85714285714, 2.95918367347, 3.0612244898, 3.16326530612, 3.26530612245, 3.36734693878, 3.4693877551, 3.57142857143, 3.67346938776, 3.77551020408, 3.87755102041, 3.97959183673, 4.08163265306, 4.18367346939, 4.28571428571, 4.38775510204, 4.48979591837, 4.59183673469, 4.69387755102, 4.79591836735, 4.89795918367, 5.0) | |
Y <- structure(c(-0.118190107029, -0.241137950416, -0.158338925665, 0.0323221253652, -0.00841516338247, 0.136627658461, -0.0156792557672, 0.186771018614, -0.0463626116349, 0.213316801375, -0.331193280292, 0.415119283831, 0.275891309679, -0.0362488511903, -0.4177531091 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "Gastby ML assignment 6" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:5480489225e5331c5fb14f21f5cb3e8312909e64210905685b98b1b36a07e6f3" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A single Shogun program | |
This documents classififier_libsvm_probabilities.cpp. | |
Cool thing is we can use standard markdown to write the documentation while the source code can be executed. Another advantage is that not all source code is pasted at once. Rather, we can write little paragraphs in between, even including math. | |
## Include and initialisation | |
First, let's include the needed header files and initialise Shogun. | |
However, if this is not documented in this doxypage (one might not want to do that as it is standard), the code still is in the source file and thus can be executed and tested. | |
### Header includes |
OlderNewer