sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
35bd02644ae4785b3f384bf1dd14a5e1e165952a356eb5096e53caac5ca8a0f9 | MATLAB | 1,402 | 64 | function NM = nk_Move2OOCV(NM,I)
if isfield(NM,'OOCV'),
OOCVind = numel(NM.OOCV)+1;
else
OOCVind = 1;
end
NM.OOCV{OOCVind}.desc = 'OOCV created by extracting cases from CV';
NM.OOCV{OOCVind}.date = date;
NM.OOCV{OOCVind}.ind = I;
NM.OOCV{OOCVind}.fldnam = 'OOCV';
nM = numel(NM.Y);
NM.OOCV{OOCVind}.c... |
dd375560ddb6db73820aa3959bcf4d8e7977210b24f745f730c0a7dabf08ce01 | MATLAB | 1,402 | 35 | function [ handles, contfl] = display_SubParam(handles, caller)
curclass = handles.popupmenu1.Value;
if strcmp(handles.popupmenu1.String{curclass},'Multi-group classifier'), curclass=1; end
param = handles.selSubParam.String{handles.selSubParam.Value};
Pind = strcmp(handles.ModelParamsDesc{curclass},param);
contfl = t... |
c730ec8d16453d0193047b8c2fc3a849d6f808ddc404fdc8c2ed39e657572e3e | MATLAB | 1,403 | 52 | function STATUS = nk_CheckFieldStatus(parent, children, grandchildren, grandchildrencrit, STATUS)
strdef = '...'; strundef = '???'; strcrit = '!!!';
n = numel(grandchildren);
missdef = cellstr(repmat(strundef,n,1));
okdef = cellstr(repmat(strdef,n,1));
if exist('grandchildren','var') && ~isempty(grandchildren)
... |
87bf3bfc8ebe7fa73c39d8b418ed0db3d6390f20ac9228f9826046a63c03e6d8 | MATLAB | 1,404 | 50 | function RedrawAxes(self, ~, ~)
MCS = MClust.GetSettings();
% Something has changed in the control window, redraw as necessary...
if self.get_redrawStatus()
% window for display
if isempty(self.CC_displayWindow) || ~ishandle(self.CC_displayWindow)
% create new drawing figure
self.CC_disp... |
edae73a2e98b94883dbef33f8934808dfdade6e1786cb46b4b7ae212c4220b44 | MATLAB | 1,404 | 45 | function I1Demo()
% I1Demo()
%
% Basic demo showing how to use the I1Toolbox.
% -Detects i1
% -Calibrates i1
% -Waits for user to press button on i1
% -Takes a single light measurement
% -Prints CIE Lxy coordinates for measurement
% -Plots raw spectral data for measurement
%
% History:
%
% Aug 23, 2012 paa... |
7ab5759880c9b93b069386b78dc5366d219d4e8168c7737522ec2e16d2bb6853 | MATLAB | 1,405 | 47 | function [sY, IN] = nk_PerfExtDimObj(Y, IN)
% =========================== WRAPPER FUNCTION ============================
if iscell(Y) && exist('IN','var') && ~isempty(IN)
sY = cell(1,numel(Y));
for i=1:numel(Y), [sY{i}, IN] = PerfExtDimObj(Y{i}, IN); end
else
[ sY, IN ] = PerfExtDimObj( Y, IN );
end
% ==... |
b901e6001d44d9309c796458780805fa58d7c6bb4a4dae91d9a5625f8efc2435 | MATLAB | 1,406 | 36 | function mp = mp2rage_defaults
%MP2RAGE_DEFAULTS contains all default values
%
% See also mp2rage_get_defaults
%% Default values
% Remove background / Interactive background
%==========================================================================
mp.rmbg.regularization = 1;
mp.rmbg.output.prefix = 'clean_';
mp... |
607b9348147459eb6819c43805c03f0faba74255ec523a5c48f8badbd84ae7cb | MATLAB | 1,409 | 60 | function [ Tr, CV, Ts, Ocv, TrainedParam ] = nk_ReturnAtOptPos(oTr, oCV, oTs, oOcv, Pnt, z, oocvonly)
if ~exist("oocvonly",'var') || isempty(oocvonly)
oocvonly = false;
end
Ocv = [];
if ~isempty(Pnt.data_ind)
Ix = Pnt.data_ind(z);
else
Ix = 1;
end
if ~isempty(oTr) && iscell(oTr)
Tr = oTr{Ix};
if ~... |
89523110ee7a6b4c36e9d1af9f9c004dceef0bba1960852ad2508d268293bee4 | MATLAB | 1,410 | 35 | function C=clustering_coef_bd(A)
%CLUSTERING_COEF_BD Clustering coefficient
%
% C = clustering_coef_bd(A);
%
% The clustering coefficient is the fraction of triangles around a node
% (equiv. the fraction of node's neighbors that are neighbors of each other).
%
% Input: A, binary directed connectio... |
049800395ce51461a64dfa9ce82cfc9eeed76914ad44c1b6ce5c82db03e7aef9 | MATLAB | 1,411 | 50 | function palm_colourbars()
% This function loops over the m-files in this directory (assumed to be
% all colour maps) and generates a .png file for each map, which can be
% used for easy choice of a map or for composition in other software
% such as Inkscape or GIMP.
% Run it without arguments.
%
% ___________________... |
4a0735e033b12ac51b39b47c6767f5c39e0aca85e39467bde95e6cc0cd8dc4e5 | MATLAB | 1,412 | 54 | function NM = nk_SwapY_OOCV(NM)
if ~isfield(NM,'OOCV')
error('No independent test data found!')
end
fl = questdlg('Are you sure you want to swap the datasets?','Swap datasets','Yes','No','No');
if strcmp(fl,'no'), return; end
nV = numel(NM.Y);
nO = numel(NM.OOCV);
if nO>1
selstr = 'select';
St = '... |
3175636a7882d7683bb2202dcf94356a94d2715da739d01afa33eacca75199be | MATLAB | 1,415 | 49 | function [w, x_hat] = fit_oracle_weights(C, x_gt, use_box_constraints)
%FIT_ORACLE_WEIGHTS Optimal linear recombination of decomposition components.
% [w, x_hat] = fit_oracle_weights(C, x_gt, use_box_constraints)
%
% Inputs:
% C : K x T component matrix
% x_gt : 1 x T or T x 1 gr... |
6177025034b97c6b986720a564ef045d8a30444457ad0700b22e3661512ae61e | MATLAB | 1,415 | 39 | function [reconX, mappedX] = run_data_through_autoenc(network, X)
%RUN_DATA_THROUGH_AUTOENC Intermediate representation and reconstruction
%
% [reconX, mappedX] = run_data_through_autoenc(network, X)
%
% Computes intermediate representation and reconstruction of the specified
% data from the specified autoencoder.
%
... |
a3b4a269f12f558709165e41751eac22de003aed910fd7ae40f5d3293dda54d7 | MATLAB | 1,416 | 35 | function PD_EEG_LFP_wav_coherence_MAIN(EventTypes, SubEventTypes)
% PD_EEG_LFP_WAV_COHERENCE_MAIN Main function for intraop EEG - LFP wavelet coherence analysis
% Input parameters
% EVENTTYPES 1xN cell array of event labels, ex: {'StimulusOn','StopSignal'};
%
% SUBEVENTTYPES Nx2 cell array of pa... |
21199f4e73f99ac5c4664abc9e5e67f6de91d8cd9b52ddf4b9bdd374a590e538 | MATLAB | 1,417 | 44 | % Objective function for NDM (using numeric integration for ode)
%
% param(1) = beta
% param(2) = x0_value
% param(3) = alpha1
function [f] = objfun_NDMwS_numeric_costopts(param,seed_location,pathology,time_stamps,C,alpha1,costfun)
beta = param(1);
x0 = param(2)*seed_location;
alpha1 = param(3);
% Calculate predict... |
3d683963b3d22ec0e621eb6291104e0ec632d4c9ca010bdfe43d161a155272a5 | MATLAB | 1,417 | 43 | % two-way anova with hemisphere as a factor: Sept 14 2022
load('N250_left.mat') % left hemisphere
[n,c2] = size(erpval);
data_left = erpval(:,[1 4]); % famous
%data_left = erpval(:,[2 5]); % familiar
load('N250_right.mat') % right hemisphere
[m,c4] = size(erpval);
data_right = erpval(:,[1 4]);
%data_right =... |
5bccfdaee7a55e6bb83084dbe0d7b3796fa060cc84234b3cb0b5b3000df1a57d | MATLAB | 1,421 | 40 | function [n,dspchans] = plx_chanmap(filename)
% plx_chanmap(filename): return map of raw DSP channel numbers for each channel
%
% [n,dspchans] = plx_chanmap(filename)
%
% INPUT:
% filename - if empty string, will use File Open dialog
%
% OUTPUT:
% n - number of spike channels
% dspchans - 1 x n array of DSP chan... |
266c6eda30b2aef280743062b8e2327252fb4f3f5517751c99bda19dde814975 | MATLAB | 1,422 | 50 | function M=find_motif34(m,n)
%FIND_MOTIF34 Motif legend
%
% Motif_matrices = find_motif34(Motif_id,Motif_class);
% Motif_id = find_motif34(Motif_matrix);
%
% This function returns all motif isomorphs for a given motif id and
% class (3 or 4). The function also returns the motif id for a given
% motif m... |
dd636392d90b4ff67c28d8fb6d4917be89014de3cc345ad0babc58ac4f582002 | MATLAB | 1,422 | 45 | classdef test_solver < matlab.unittest.TestCase
properties
num_output
solver
end
methods
function self = test_solver()
self.num_output = 13;
model_file = caffe.test.test_net.simple_net_file(self.num_output);
solver_file = tempname();
fid = fopen(solver_file, 'w');
... |
06fbdcfb93b1cab6d632bfaf4835dd1e7c5e9ff666dd58a781ef9fd64321a80b | MATLAB | 1,428 | 43 | function est = mripy_est_from_PEB_BMA(BMA, norm, effect)
% Extract estimates from a PEB BMA object.
% est.A, est.B, est.C, est.PA, est.PB, est.PC
%
% norm : bool
% Whether to show standardized z value as edge width in the graph.
% true: show z value = mean/std
% false: show original val... |
5c28f508031154de1eb05cfd91ebdc934f777359d6b837fcd082ae02cff562e7 | MATLAB | 1,432 | 50 | function [id, rect, shader] = CreateProceduralCheckerboard(windowPtr, width, height, radius)
% [id, rect, shader] = CreateProceduralCheckerboard(windowPtr, width, height, [, radius=inf])
%
% A procedural checkerboard shader
%
% See also: CreateProceduralSineGrating, CreateProceduralSineSquareGrating
% History:
% 06/0... |
3cabfbbe3a588c5e1c5f27bea8e7ef88e9fa9bed06e0dc1dffcd828ae9031220 | MATLAB | 1,434 | 64 | function [fea] = mrmr_mid_d(d, f, K, bdisp)
% function [fea] = mrmr_mid_d(d, f, K)
%
% MID scheme according to MRMR
%
% By Hanchuan Peng
% April 16, 2003
%
if ~exist('bdisp','var'), bdisp = 0; end;
nd = size(d,2);
t = zeros(nd,1);
for i=1:nd,
t(i) = mutualinfo(d(:,i), f);
end;
%fprintf('calculate the marginal d... |
7e1b43724e5b699ab661e16588b9fcb4c9d76ceda78d65de144e97c57deb3780 | MATLAB | 1,434 | 54 | function [inW, bias, outW, scores] = elmTrain( X, Y, nHiddenNeurons, C )
% FUNCTION trains the Extreme Learning Machine. The activation function is
% sigmoid which could be changed easily if needed.
%
% [inW, bias, outW, scores] = elmTrain( X, Y, nHiddenNeurons, C );
%
% INPUT :
% X - data patterns (column vectors)
... |
f1d2008c56b54ddd07a5a1a905faa5b6cad9f77679e245646424339c05b02111 | MATLAB | 1,435 | 41 | function [C, dC] = gplvm_grad(x, X, sigma)
%GPLVM_GRAD Gradient of the Gaussian Process Latent Variable model
%
% [C, dC] = gplvm_grad(x, no_dims, sigma)
%
% Computes the gradient of the Gaussian Process Latent Variable model.
% This file is part of the Matlab Toolbox for Dimensionality Reduction.
% The toolbox can ... |
1842904387ae23c6b6fcbe413b9968a40a7ebeccae3ca8642a226829fea3b8e3 | MATLAB | 1,436 | 42 | function inv = chi2inv (x, n)
% CHI2INV Quantile function of the chi-square distribution
% INV = chi2inv(X, N) computes, for each element of X, the
% quantile (the inverse of the CDF) at X of the chi-square
% distribution with N degrees of freedom.
% Adapted for Matlab (R) from GNU Octave 3.0.1
% Original file: st... |
ff0374d138e6e050ec8c65cc7868e8b84d61002561e11055c5f78c4606e4b5ce | MATLAB | 1,437 | 42 | % This is an example of how to use the "biCluster" finction and how to draw
% the heatmap after biclustering.
%%%%
% Copyright (C) <2012> <Yifeng Li>
%
% 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 Foun... |
05607bc0b699d1dd3d03e4b2471cb2facda4c86b5a9ff33186bec5e758d3958f | MATLAB | 1,440 | 49 | clear; clc;
load data;
%% Apply linear SVM regression model to make predictions
disp('Using Linear SVM ')
svmStruct = svmtrain(XTR,YTR,'ShowPlot',true);
title('Linear SVM')
PTR = Mysvmclassify(svmStruct,XTR);
PTR = exp(PTR)./(1+exp(PTR));% Convert output of SVM to uncalibrated probs
PTE = Mysvmclassify(svmStruct,XTE)... |
3e534b791e09e5dce8602c6896109299ffd1272635cb7ebc0307d0465d16b2a5 | MATLAB | 1,444 | 46 | function ddplot(x,y,cutoff,attrib,nid)
%DDPLOT is the distance-distance plot as introduced by Rousseeuw and Van
% Zomeren (1990, JASA, 85, 633-639). The Robust distances based on the MCD (mcdcov.m)
% are plotted against the Mahalanobis distances. Cutoff lines permit the
% classification of outliers.
%
% Required inpu... |
6dd20aeb28906e6b7101c214ad0bb1b7fb9b19c530b6a4eb04ec558c3fc7a5b5 | MATLAB | 1,446 | 54 | function ClusterFunc_ShowWaveforms(self)
% ClusterFunc_ShowWaveforms(self)
% ADR 2012
% ADR 2013-12-12
%
%===============================================================
% PARAMETERS
%===============================================================
useSelfColor = true;
% GO
MCS = MClust.GetSettings();
WV = self.Ge... |
7bbbd28991bd4bad3b117c342b51c54cd8eb99ea5c91e97a48bef1c569419117 | MATLAB | 1,449 | 52 | <<<<<<< HEAD
function display(this)
% Display method for GIfTI objects
% FORMAT display(this)
% this - GIfTI object
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Guillaume Flandin
% $Id: display.m 4182 2011-02-01 12:... |
e16d40a3bbae2e1d44753f9c41cf7bced719945d6fc18dfb365d1d24ee813ab8 | MATLAB | 1,450 | 44 | % Objective function for NDMwMC (using numeric integration for ode)
%
% param(1) = beta
% param(2) = x0_value
% param(3) = alpha0 = cte growth/decay term on u
function [f] = objfun_NDMwMC_numeric_costopts(param,seed_location,pathology,time_stamps,C,u,costfun)
beta = param(1);
x0 = param(2)*seed_location;
alpha0 = pa... |
d38973e16f67fdbc6297021fc84b987365f461e82ebc596441605bdebcf9aa79 | MATLAB | 1,451 | 54 | %% FUNCTION combine_input
% transform X, Y cell array input into matrix/vector input with
% ind and ssize.
%
%% INPUT
% X: {[n_i, d]}*t
% Y: {[n_i, 1]}*t
%
%% OUTPUT
% Xcmb: [\sum_i n_i, d]
% Ycmb: [\sum_i n_i, 1]
% ind: index
% ssize: the array of size
%
%% LICENSE
% This program is free software: y... |
eaf9c4534848e1a7520ea95bc67dad72f6994547f55bd750db82c32b42dc7306 | MATLAB | 1,453 | 51 | function demo_face_with_outlier_online()
% Demonstation file for robust online NMF for face images with outlier
%
% Created by H.Kasai on Apr. 18, 2018
clc;
clear;
close all;
%% set parameters
max_epoch = 500;
batch_size = 100;
N = 1000;
K = 49;
outl... |
2c788d953c9a18c5363d138bd38eac1c24aef8c6c959ed094d57179e5c275b78 | MATLAB | 1,456 | 47 | function [Ppos,Pneg]=participation_coef_sign(W,Ci)
%PARTICIPATION_COEF_SIGN Participation coefficient
%
% [Ppos Pneg] = participation_coef_sign(W,Ci);
%
% Participation coefficient is a measure of diversity of intermodular
% connections of individual nodes.
%
% Inputs: W, undirected connection matr... |
3de25644a81cae30d21364c7bd27cc71f0f66d718cc5d93f60272fb872cea669 | MATLAB | 1,459 | 53 | function f = nmf_cost(V, W, H, R, varargin)
% Calculate the cost function of NMF.
%
% This file is part of NMFLibrary.
%
% Created by H.Kasai on Feb. 21, 2017
% Modified by H.Kasai on Jul. 23, 2018
Vhat = W * H + R;
if isempty(varargin) || strcmp(varargin{1}, 'EUC')
f = norm(V - Vhat,'fro')^2... |
fded8c4c5bfab43c5e8e8c70d5b675171cfb24cc62ecd859ed7cbdcdfb95f882 | MATLAB | 1,459 | 48 | % File Array Object
%
% file_array - create a file_array
% horzcat - horizontal concatenation
% vertcat - vertical concatenation
% size - size of array
% length - length of longest dimension
% subsref - subscripted reference
% end - last index in an indexing express... |
e944ef2bb325fa11ae3431dd6ba7d84fb649a6234429b76babf92056bf810a65 | MATLAB | 1,460 | 50 | function [maps, weights] = ecalib_2d( ksp, ncalib, ksize)
eigThresh_k = 0.02; % threshold of eigenvectors in k-space
%eigThresh_k = 0.001; % threshold of eigenvectors in k-space
eigThresh_im = 0.9; % threshold of eigenvectors in image space
%eigThresh_im = 0.85; % threshold of eigenvectors in image space
% Generate E... |
773fbeb80d117f46da072e01a8b9d1cd9b79d149b3556960d85509b601b22626 | MATLAB | 1,462 | 44 | % Objective function for NDMwC (using numeric integration for ode)
%
% param(1) = beta
% param(2) = x0_value
% param(3) = alpha0 = cte growth/decay term independent of x
function [f] = objfun_NDMwC_numeric_costopts(param,seed_location,pathology,time_stamps,C,alpha0,costfun)
beta = param(1);
x0 = param(2)*seed_locatio... |
f0d64636004f46ddc950a2f2f86801c9bdc505e9c5f82d87fae6f4cd867f1627 | MATLAB | 1,466 | 49 | function P=participation_coef(W,Ci,flag)
%PARTICIPATION_COEF Participation coefficient
%
% P = participation_coef(W,Ci);
%
% Participation coefficient is a measure of diversity of intermodular
% connections of individual nodes.
%
% Inputs: W, binary/weighted, directed/undirected connection matrix
%... |
8bb233793dd6d9da64e8edc2676223e5a1b5ecb12f3a81ab82eec429c6b8db3c | MATLAB | 1,467 | 48 | function V = mp2rage_display_volume(V,Y)
%MP2RAGE_DISPLAY_VOLUME will write a volume in a temporary file, and
%display it using SPM image display.
%
% INPUT
% - V is a structure, output of V = spm_vol('path/to/volume.nii')
% - Y is a 3D cube, output of Y = spm_read_vols(V)
% this is the cube==image you want to disp... |
3f8a211e3ebb036ca2ae2f5bad308b03b468dc553fcadacd49583f6c1799e672 | MATLAB | 1,468 | 48 | function [result] = mc(x)
%MC calculates the medcouple, a robust measure of skewness.
%
% The medcouple is described in:
% Brys, G., Hubert, M. and Struyf, A. (2004),
% "A Robust Measure of Skewness",
% Journal of Computational and Graphical Statistics,
% 13, 996-1017.
%
% Required input arguments:
% x... |
2f13df402c2a598d787dcef4baa7a2446a026a089a38fa044e2a8d87d88184c3 | MATLAB | 1,469 | 50 | classdef mRVM_train_output < handle
properties
model_used;
dataset_name;
N_total;
N_prototypical;
X_prototypical;
X_prototypical_standardized;
K_sparse;
W_sparse;
active_sample_original_indices;
... |
a4fc35a739d45bea69a7f38eeab9fafde55b849e070a6165e87eace4a646a6ce | MATLAB | 1,472 | 44 | function [p,dist]=purity(indCluster,classes)
% compute purity of clustering according to class information
% indCluster: column vector, the cluster index of each data point
% classes: column vector, the class label of each data point
% p: scalar, purity
% dist: the distribution matrix of clustering
%%%%
% Copyright (C)... |
c96736e3e23347fda22c2c46f5bb239e73ae56553174a7119b3b33f8aea46d33 | MATLAB | 1,473 | 48 | function [varargout] = RenyiMIToolbox(functionName, alpha, varargin)
%function [varargout] = RenyiMIToolbox(functionName, alpha, varargin)
%
%Provides access to the functions in RenyiMIToolboxMex
%
%Expects column vectors, will not work with row vectors
%
%Function list
%"Entropy" = H_{\alpha}(X) = 1
%"MI" = I_{\alpha}... |
92a1d6561a2bdd5c83bed67fdf042b99f7afb5686f96eb0b8249ecb005ff0889 | MATLAB | 1,474 | 51 | % finds all movie files in current directory and all subdirectories
function [filename,folders,namef] = findMovieFolders(h,folder_name)
filename = {};
folders = {};
namef = {};
fs = dir(folder_name);
fs = fs(3:end);
%% check for files in root folder
if ~isempty(fs)
isfolderf=[fs.isdir];
... |
3ad91abbe8071e6cd297f445c38b40bcffc1494a2085bbb55fb22ac120e47f18 | MATLAB | 1,475 | 35 | function TEMPL = nk_CreatePreprocTemplate(Y, label)
global CV RAND PREPROC MODEFL VERBOSE
if isfield(PREPROC,'TEMPLPROC') && ~isempty(PREPROC.TEMPLPROC) && PREPROC.TEMPLPROC
if VERBOSE, fprintf('\nCreate full population preprocessing template for Procrustes aligmnent'); end
nshelves = numel(Y);
switch MODE... |
d4d5f82d1a335a64d2b71343c806ffba388541fea706c6bcb6fcc859196ae769 | MATLAB | 1,477 | 54 | %% FUNCTION solve_trace_norm_RMTL
% trace norm projection
%
%% LICENSE
% 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 ... |
252b02d34d1857e63a08d69e97e64765640219db23b1ade21e887229431b1a65 | MATLAB | 1,479 | 61 | % RELIEF - Kira & Rendell 1992
% T is number of patterns to use
% Defaults to all patterns if not specified.
%
% The license is in the license.txt provided.
%
% function w = RELIEF( data, labels, T )
%
function [w bestidx] = RELIEF ( data, labels, T )
if ~exist('T','var')
T=size(data,1);
end
idx = randperm(lengt... |
18b542e558c6c4ccc654a9d78e28b1a4b7ae6339c25f08799d58dfc14a48a762 | MATLAB | 1,482 | 43 | function hi = plotshaded(x, y, fstr, mrksize, linsize, rotateflag)
% x: x coordinates
% y: either just one y vector, or 2xN or 3xN matrix of y-data
% fstr: format ('r' or 'b--' etc)
%
% example
% x=[-10:.1:10];plotshaded(x,[sin(x.*1.1)+1;sin(x*.9)-1],'r');
if ~exist('mrksize', 'var') || isempty(mrksize), mrksize = 10... |
af28811b02f7d0e00b92f0e5d66de4fa41e2265c83b382962f85cdacd3b85c7a | MATLAB | 1,482 | 43 | function concatInfo = excludeBadAlign(concatInfo)
CorrValues = concatInfo.AllCorrelation;
ff = figure;
imagesc(CorrValues),caxis([0 1])
title('Correlation Matrix'),colormap(jet),colorbar
xlabel('Sessions'),ylabel('Sessions')
set(gca,'ticklength',[0 0],'fontsize',12,'fontweight','bold')
nSessions = length(concatInfo.Se... |
3272899fcfaaaec81287aac0e34b4e7a59afada2991b31a982eb9a4d2b6a3914 | MATLAB | 1,485 | 44 | function [model] = ml_binaryclass_basis(X,y,options)
% ml_binaryclass_basis(X,y,options)
%
% Description:
% - Binary classification after a change of basis
%
% Options:
% - subModel: the model used for classification (default: brokenStump)
% - subOptions: options for subModel (default: none)
% - basisFunc: func... |
33929b8260774a3fd5089af7d4569dff3cdb1794ef4da84054ef1e8bc3947035 | MATLAB | 1,485 | 53 | function [X,Y,Z] = adjacency_plot_und(aij,coor)
%ADJACENCY_PLOT_UND Quick visualization tool
%
% [X,Y,Z] = ADJACENCY_PLOT(AIJ,COOR) takes adjacency matrix AIJ and node
% spatial coordinates COOR and generates three vectors that can be used
% for quickly plotting the edges in AIJ. If no coordinates are specifi... |
497b3c1a01c63a506e078cd5a804841ea7ad2a1053e6d7c129ec2e7ef380f9c5 | MATLAB | 1,486 | 51 | function K=computeKernelMatrix(A,B,option)
% Compute the kernel matrix, K=kernel(A,B)
% A: matrix, each column is a sample
% B: matrix, each column is a sample
% option: struct, include files:
% option.kernel: string, can be 'linear','polynomial','rbf','sigmoid','ds'
% option.param
% K: the kernel matrix
% Yifeng Li, S... |
73941f992be49b0c56ecc111d36d29e1eb1ca8d03dddd08009f3c9ebeca4b708 | MATLAB | 1,486 | 49 | function K = WL_with_prior_sparsityThres_Ttest(y, Y1, Y2, sp, param1) % in case of test kernel, Y1 should be Ytest
if ~isequal(Y1,Y2)
test = 1;
spY1 = Y1;
for i = 1:size(Y1,1)
% apply sparsity threshold
spArray = apply_sparsity_thres(Y1(i,:), sp);
spY... |
ac870b743e7023ab1498cbbbed3157aa751fd0c1fc0160d5b7f1c033ce6ea638 | MATLAB | 1,486 | 60 | function [K,runtime]=RWkernel(Graphs, lambda)
% Compute a random walk kernel for a set of graphs
% Copyright 2011 Karsten Borgwardt, Nino Shervashidze
% Input: Graphs - a 1xN array of graphs represented just with adjacency matrices
% Graphs(i).am is the i'th adjacency matrix
% Graphs(i) may have other fields, ... |
043199453ec22b05ce9bbd319161b0f60b5da83536f8103c9616af1f110d7e81 | MATLAB | 1,488 | 41 | function a = file_array(varargin)
% Function for creating file_array objects.
% FORMAT a = file_array(fname,dim,dtype,offset,scl_slope,scl_inter,permission)
% a - file_array object
% fname - filename
% dim - dimensions (default = [0 0] )
% dtype - datatype (default = 'uint8-le')
% offset ... |
049772e0b236f3b74e7b88f66a10bbefc8e799a9d8697b00ac88145331bf8951 | MATLAB | 1,489 | 50 | function [sorted_dists, NNs, dists] = getLooNN(X, X_square, weights, inds)
% [sorted_dists, NNs] = getLooNN(X, X_square, weights, inds);
%
% is used by RGS and SKS
%
% sorted_dists(i,j) = the distance to from instance i in the training
% set the j'th closest instance in the training set... |
1cb8a01fedd9f6d34e73f38f8a7cd04a588c1a3c5592262e3408062cfb0bd2f8 | MATLAB | 1,490 | 46 | function ind = nk_MRMR(Y, label, k, params)
global MODEFL VERBOSE
switch params.cmd
case 'discretize'
if VERBOSE; fprintf(' Discretize [ %g : %g : %g ]... ', ...
params.DISCRET.binstart,params.DISCRET.binsteps, params.DISCRET.binstop);
end
Y = discretize... |
442431a7bcd1e720b108e26a2bd1d894e802528a1ee3554d37a037bb12e25b8a | MATLAB | 1,490 | 53 | function scores = infoGain(X_train, Y_train)
% scores = infoGain(X_train, Y_train);
%
% Implementation of infoGain feature selection, as used in:
%
% A. Navot, L. Shpigelman, N. Tishby, E. Vaadia. Nearest Neighbor Based Feature Selection for Regression and its
% Application to Neural Activity. Submitted to NIPS 2005.
... |
ff6034453d00dfcaa4113e233968777e170e874d0c346611cee5afb56a1c0f96 | MATLAB | 1,491 | 54 | function scores = infoGain(X_train, Y_train)
% scores = infoGain(X_train, Y_train);
%
% Implementation of infoGain feature selection, as used in:
%
% A. Navot, L. Shpigelman, N. Tishby, E. Vaadia. Nearest Neighbor Based Feature Selection for Regression and its
% Application to Neural Activity. Submitted to NIPS 2005.
... |
9949d98515e834f6007708cd9615a6a9cdcefe343d900568b74c5b978f4dc2ed | MATLAB | 1,492 | 41 | function [NM, act] = nk_SavingOptions_config(NM, defaultsfl, parentstr)
saving = 0;
switch NM.modeflag
case 'classification'
pref = 'ClassModel';
if numel(NM.groupnames)>2
grname = 'Multi';
else
grname = sprintf('%s-%s', NM.groupnames{1}, NM.groupnames{2});
... |
7a7a39355e9e1f32bf96bceed22f912ca1a1b2e63a5a6408b9307c567e136fe9 | MATLAB | 1,493 | 41 | function [n, evchans] = plx_event_chanmap(filename)
% plx_event_chanmap(filename): return map of raw event numbers for each channel
%
% [n, evchans] = plx_event_chanmap(filename)
%
% INPUT:
% filename - if empty string, will use File Open dialog
%
% OUTPUT:
% n - number of event channels
% evchans - 1 x n array ... |
08021025e0c42371fb80221505ee7b86c733f92b2a18789a5552c05e010c3b9e | MATLAB | 1,495 | 60 | function fns = FindFiles(globfn, varargin)
% fns = FindFiles(globfn, parameters)
%
% Finds all files that match a wildcard input globfn.
% Based on matlab's dir function.
% Searches all directories under the current directory.
%
% INPUTS
% globfn -- filename to search for (you can use '*',
% but no... |
aba0af8db3fb4d1aecd3ef05ec236c722807c985353445215b02c4a993feccdc | MATLAB | 1,497 | 66 | classdef TwoRadioSwitch < handle
properties
buttongroup;
buttonA;
buttonB;
end
methods
function self = TwoRadioSwitch(varargin)
AName = 'A'; BName = 'B';
varargin = process_varargin(varargin);
self.buttongroup = feval(@uibuttongroup, varargin{:});
set(self.buttongroup, 'Units', 'Normalized'... |
e2fbc4dae7dd5f146f421f15a8d8f6726a0b7101aaa8199c51998863126bdee2 | MATLAB | 1,498 | 39 | function handles = sel_onevsone(handles, hObject)
rowind = get(hObject,'Value');
switch rowind
case 1
%% Display ROC
delete(findall(handles.figure1,'Tag','AnnotPerfMeas'))
[handles.hroc, handles.hroc_random] = display_roc(handles);
%% Display Cobweb
[handles.hspider, handle... |
61eec58fc695efebb5b1254615430171ffe8d2b1c6f6f6c229679ee987f40340 | MATLAB | 1,501 | 41 | % Feature Extraction Toolbox by Jingwei Too - 12/12/2020
function feat = jfeeg(type,X,opts)
switch type
case 'mcl' ; fun = @jMeanCurveLength;
case 'ha' ; fun = @jHjorthActivity;
case 'hm' ; fun = @jHjorthMobility;
case 'hc' ; fun = @jHjorthComplexity;
case '1d' ; fun = @jFirstDiffe... |
e286cf02e256643f1eb47c4d24b1acce4cfca2c9ad72003c2aeede798dd32919 | MATLAB | 1,501 | 39 | % CL Septembre 2022, landelle.caroline@gmail.com // caroline.landelle@mcgill.ca
% Toolbox required: Matlab, SPM12
%%
function Norm=Norm_func2anat(filename_funcmean,filename_anat, dir4D,filenames_func4D,SPM_Dir)
%______________________________________________________________________
%% Initialization
%____________... |
2c0ecaad1c562c50ede131ad9314d30f03706da25be641d9a3940716b194751c | MATLAB | 1,506 | 58 | function [model] = ml_binaryclass_exponential(X,y,options)
% ml_binaryclass_exponential(X,y,options)
%
% Description:
% - Fits a linear classifier by minimizing the exponential loss
%
% Options:
% - addBias: adds a bias variable (default: 0)
% - lambdaL2: strenght of L2-regularization parameter (default: 0)
%
% A... |
4fe8647deb96ab64c74d6790ae9ea4e46a47ae52a0312107ca442958fc22eacc | MATLAB | 1,506 | 63 | function RedrawClusters(self)
% Redraw clusters within panel
%-----------------------
% FROM @Cutter - need to hide and disable primary cluster
% Redraw clusters within panel
uicHeight = 0.05;
nClustersInPanel = floor(1/uicHeight);
panel = self.clusterPanel;
% clear old display
if ~isempty(get(panel, 'children'))
... |
86b8359ed9ebe12ae078c19f4dfef6563768fe9bbfd61951727ef0fe2f923917 | MATLAB | 1,506 | 47 | function Y = mvu_x(X, no_dims, K, lambda)
%MVU_X This file is not currently used by the toolbox
% This file is part of the Matlab Toolbox for Dimensionality Reduction.
% The toolbox can be obtained from http://homepage.tudelft.nl/19j49
% You are free to use, change, or redistribute this code in any way you
% want for ... |
b278e816ecd8d85b2c6075e2cc2749636a992999433458c30bd8dcae015ad017 | MATLAB | 1,506 | 75 | function timecourse(f,nocolor,smoothed)
if nargin < 3 || isempty(smoothed)
smoothed = false;
end
if nargin < 2 || isempty(nocolor)
nocolor = false;
end
figure
m = f.model;
if isempty(m.param_symbols)
disp('Retrieving model parameter symbols and units using new instance of the class')
m = feval(class(... |
115de946cb1c62dd29dbfea0e247ce51d56982282fc6cfc56854cc9a85da87c8 | MATLAB | 1,507 | 46 | % Objective function for NDMwSwC (using numeric integration for ode)
%
% param(1) = beta
% param(2) = x0_value
% param(3) = alpha0 = cte growth/decay term independent of x
% param(4) = alpha1
function [f] = objfun_NDMwSwC_numeric_costopts(param,seed_location,pathology,time_stamps,C,costfun)
beta = param(1);
x0 = para... |
82ef93997d0e0fbe83ba1c62206ead2f2467215183e3fa08861071057bcec1a1 | MATLAB | 1,508 | 39 | function [R, optmodel] = nk_MLOptimizer_Wrapper(Y, label, Ynew, labelnew, Ps, FullParam, SubFeat)
global RFE SVM
if nargin < 7, SubFeat = true(1,size(Y,2)); end
ActStr = {'Tr', 'CV', 'TrCV'};
% Remove cases which are completely NaN
[Y, label] = nk_ManageNanCases(Y, label);
[Ynew, labelnew] = nk_ManageNanCases(Ynew, ... |
b0eec67e322d0722842a9e63f6337e6f2fe2edebe4b705a96f481dfbc8a4493e | MATLAB | 1,509 | 49 | function Matrix = NormConcatVideo(Matrix,concatInfo,savingPath)
%%% Normalize the concatenated videos to enhance cell detection
Dims = size(Matrix);
Matrix = single(reshape(Matrix,prod(Dims(1:2)),Dims(3)));
win = floor(concatInfo.FrameRate);
HalthWin = ceil(win/2);
Sizes = concatInfo.NumberFramesSessions;
nPix = size... |
91a79ed28146f1f0f4fca9a2aed37fe195f985c3672d2c18bc5c37ef874ea5b6 | MATLAB | 1,512 | 61 | function [f,bic] = fit_br_bic(idx)
romesh_utils.matlabpool_cluster(12)
tic;
eegdb = data.eeg_database;
files = eegdb.get('br_tfs','EC');
eegdb.close();
n_fits = length(files);
bic = zeros(n_fits,1);
f(n_fits) = bt.feather;
debugmode = false;
npts_per_fit = 5e4;
parfor j = 1:n_fits
initial_params_overri... |
885e9ec0858701fab96792514c4620987f33f7c34f0522a7638213ba1f04b17d | MATLAB | 1,513 | 52 | function [adfreq, n, ad] = plx_ad_span_v(filename, channel, startCount, endCount)
% plx_ad_span_v(filename, channel): read a span of a/d data from a .plx or .pl2 file
%
% [adfreq, n, ad] = plx_ad_span_v(filename, channel, startCount, endCount)
%
% INPUT:
% filename - if empty string, will use File Open dialog
% sta... |
def0fd9a866ef4d656510d1205028678408b49453de3439a06e41d0b8ffb95ed | MATLAB | 1,513 | 48 | classdef spatial_express_t0_noemg_alphaweighted < bt.model.spatial_express_t0_noemg
% This is a template function that allows rapid prototyping of new spatial
% fitting by leveraging model.params.spatial_spectrum with absolutely
% no regard for performance
properties
% No new properties required by this derived ... |
01cc05382c16ec3351d9f8bf5799bbf20eac89029808dd9e8d80072ccb9a9594 | MATLAB | 1,519 | 44 | function [A,meanVec,stdVec]=normmean0std1(A,meanVec,stdVec)
% normalize each column to have mean 0 and std 1
% Usuage:
% [A,meanVec,stdVec]=normmean0std1(A)
% [A,meanVec,stdVec]=normmean0std1(A,meanVec,stdVec)
% A, matrix of size m by n, with samples in rows, and features in columns
% meanVec: row vector of length n
%... |
d5a89816266865471564e6d0e212f5c56d372ad6a8de852e1abb57567349e672 | MATLAB | 1,521 | 46 | function [X,Y,indsort] = grid_communities(c)
% GRID_COMMUNITIES Outline communities along diagonal
%
% [X Y INDSORT] = GRID_COMMUNITIES(C) takes a vector of community
% assignments C and returns three output arguments for visualizing the
% communities. The third is INDSORT, which is an ordering of the verti... |
2e6cd4e4a6505b308f56d72079c02ce0df1a113ecba3aecc4038836b5760f60a | MATLAB | 1,523 | 50 | function mexall
%MEXALL Compiles all MEX-files of the Matlab Toolbox for Dimensionality Reduction
%
% mexall
%
% Compiles all MEX-files of the Matlab Toolbox for Dimensionality Reduction.
%
%
% This file is part of the Matlab Toolbox for Dimensionality Reduction.
% The toolbox can be obtained from http://homepage.tu... |
5ea151b127cd130ba8fc8e4f5584adf87070ef16d800fcdf13cb1a76c4a454a1 | MATLAB | 1,523 | 53 | function A = randomize_graph_partial_und(A,B,maxswap)
% RANDOMIZE_GRAPH_PARTIAL_UND Swap edges with preserved degree sequence
%
% A = RANDOMIZE_GRAPH_PARTIAL_UND(A,B,MAXSWAP) takes adjacency matrices A
% and B and attempts to randomize matrix A by performing MAXSWAP
% rewirings. The rewirings will avoid any ... |
5df9abf056564e78b0653ed93cc0f6090bffa14b55e6e1d497f365308f07904b | MATLAB | 1,526 | 59 | % Electroencephalogram (EEG) Feature Extraction toolbox
%---Input-------------------------------------------------------------
% X : EEG signal (1 x samples)
% opts : parameter settings
%
%---Output------------------------------------------------------------
% feat: Feature vector
%-------------------... |
7e9c3f91aa531fa05f82b218df306ea67ec9103c9608f7d3c485f7dcfca78faf | MATLAB | 1,527 | 40 | function [data, label] = data_normalization(data, label, method)
% Data normalization
%
% Inputs:
% data data of size dxn, where d is dimension and n is number of sets
% label label data of size 1xn, n is number of labels.
% Output:
% data normalized data ... |
a97864f295f286ec2b1482dee22331e9fff857cec27527a46e3b6cbc235b6d39 | MATLAB | 1,529 | 58 | function [selectedFeatures] = FCBF(featureMatrix,classColumn,threshold)
%function [selectedFeatures] = FCBF(featureMatrix,classColumn,threshold)
%
%Performs feature selection using the FCBF measure by Yu and Liu 2004.
%
%Instead of selecting a fixed number of features it provides a relevancy threshold and selects all
%... |
bcf5bd2ccba73cff7e8ccd8c5ee4f1619a92c73f5d98e51807929dfee603e9df | MATLAB | 1,530 | 79 | function [K, runtime] = gestkernel3(graph,samplesize)
% 3-node graphlet kernel
% calculate results for pairs of graphs
P = Permutationmatrix3;
t=cputime; % for measuring runtime
for i = 1:size(graph,2)
% %i
% am1 = graph(i).am;
% sp1 = floydwarshall(am1);
% sp1(find(sp1 == Inf)) = 0;
% graph(i).sp = s... |
7d13228487cf35af8ea4ac2f29656798818d1b321c44f82ee5a6a3dae1bef988 | MATLAB | 1,532 | 40 | function create_EventSpikes_mat(pdcells)
%CREATE_EVENTSPIKES_MAT Saves event-related spikes and epoch rates
% CREATE_EVENTSPIKES_MAT(pdcells)
% -define events and event epochs for SSRT task
% -extract and align spikes in each trial relative to trial events
% -calculate spike rates in fixed... |
b7cfca0688663b5415cdda8dc9f937357184e82e34e06d3fff108d75b2d0e736 | MATLAB | 1,532 | 51 | function assemble_master_pp
states = {'eo','ec','rem','n1','n2','n3','n2s'};
cutdown = [1 1 1 1 1 1 1 1];
db_data = {};
for j = 1:length(states)
db_data{j} = db_fit_make_pp(states{j},cutdown(j));
end
for j = 2:length(states)
db_data{1}.P = [db_data{1}.P; db_data{j}.P];
db_data{1}.xyz = [db_data{1}.xyz; db... |
1a548ce79ec69b11b4f8047d014adc22af824c754b2c9ec76249e58e40a86a1c | MATLAB | 1,533 | 40 | function [Y,numIter,tElapsed]=nmfnnlstest(X,outTrain)
% map the test/unknown samples into the NMF feature space
% X: matrix, test/unknown set, each column is a sample, each row is a feature.
% outTrain: struct, related options in the training step.
% outTrain.factors: column vector of cell of length 2, contain the matr... |
1c5defe520bff196f83e1f707503ec7cc7d1f4be94e76a7ea1b6c8e4b8466703 | MATLAB | 1,536 | 48 | function param = nk_SetupIMReliefParams_config(res, param, setupfl)
if ~exist('setupfl','var')
if isfield(param,'imrelief'), setupfl = false; else setupfl = true; end
end
nclass = numel(unique(res.label));
if nclass > 2
fprintf('\nNeuroMiner detected that you have specified %g binary classifiers in your NM s... |
5a8c1478fc270defc5bd3593c3f1a0eba32df660edfc5ac655afbff440efcba1 | MATLAB | 1,538 | 26 | % to be run before running the demos in order to identify the location of
% input data on your computer and generate the paths to input data.
% Trang Cao, Neural Systems and Behaviour Lab, Monash University, 2024.
clear all
close all
wdir = pwd();
%% make map list file by adding dataDir
% for demo_sim
dataDir = ful... |
527bf69f27b3eb5df94e4092182ecb693ff8c40658ea16905b66b2049cac5eaa | MATLAB | 1,544 | 59 | function result=twopoints(data,ndirect,seed)
%TWOPOINTS calculates ndirect directions through two randomly chosen data points from data.
% If ndirect is larger than the number of all possible directions, then all
% these combinations are considered.
%
% Required input arguments:
% data : Data matrix
% ndir... |
98c721fdb074c9ff898c0602cbc70b0048268e5321d9e1dc6b40180023d5f777 | MATLAB | 1,550 | 79 | function result=madc(x)
%MADC is a scale estimator given by the Median Absolute Deviation
% with finite sample correction factor.
% It is defined as
% mad(x)= b_n 1.4826 med(|x_i - med(x)|)
% with b_n a small sample correction factor to make the mad unbiased at the
% normal distribution. It can resist 50% ... |
2645af346e833c15fa0af9aa5e6b035d5d2ca0bdd100110c2061df9d8db78e8a | MATLAB | 1,554 | 38 | function [f_fitted,P_fitted,idx,db_data,min_chisq] = quick_fit(model,target_f,target_P,force_wake_state)
% Fit a power spectrum to a parameter combination already in a database
% Arguments are
% model - BrainTrak model
% target_f - experimental frequencies
% target_P - experimental power
% force... |
3ae48ac04320d6e645425db217c408dbde0394fc31c55ddce86c2d0a892dc2de | MATLAB | 1,554 | 55 | function test_symm()
%
% demonstration file for NMFLibrary.
%
% This file illustrates how to use this library.
% This demonstrates Symm-ANLS algorithm and Symm-Newton algorithm.
%
% This file is part of NMFLibrary.
%
% Created by H.Kasai on Jun. 24, 2019
clc;
clear;
close all;
%% generate synthetic d... |
548ba3c7ff0fa96e7383b11b078a84e640e644303a82494fc5f6d3a41f0e889e | MATLAB | 1,556 | 42 | function C=clustering_coef_wd(W)
%CLUSTERING_COEF_WD Clustering coefficient
%
% C = clustering_coef_wd(W);
%
% The weighted clustering coefficient is the average "intensity"
% (geometric mean) of all triangles associated with each node.
%
% Input: W, weighted directed connection matrix
% ... |
929f20479a0697bcf1b758bf6ef541ed4c472f217fa2ae6f347dadbd51866268 | MATLAB | 1,556 | 47 | function addOptickaToPath()
% adds opticka to path, ignoring at least some of the unneeded folders
tt = tic;
mpath = path;
mpath = strsplit(mpath, pathsep);
opath = fileparts(mfilename('fullpath'));
%remove any old paths
opathesc = regexptranslate('escape',opath);
oldPath = ~cellfun(@isempty,regexpi(mpath... |
e509f1c0f536faa2a09167f6407b33237f0340d0f999208b9a8ea06e270f928b | MATLAB | 1,556 | 47 | function EEG = load_intraoplfp(currsess,patnm,side);
%LOAD_INTRAOPLFP Loads microelectrode recording (MER) data
% EEG = load_intraoplfp(currsess,patnm,side) loads MER channel data,
% saved as *.mat files in the patient result directory.
% into a data structure (eeglab format).
%
% Input paramete... |
c420e0a45d479b5660bd09a0db1cd965e11ed63602cd65de4725f67a31472231 | MATLAB | 1,557 | 59 | function liteTimeSeries(filename,varargin)
% inputs
p = inputParser;
p.addRequired('filename',@(x) exist(x,'file'));
p.addParameter('keep',{'WT:WT','HET:HET','HOM:HOM'},@iscellstr);
p.addParameter('save','',@ischar);
p.parse(filename,varargin{:});
inputs = p.Results;
% open fig, get legend, and names
f = open(filename... |
6991048ff3ae3d77daa6c23c3500fd1327b0ecce7a0107d1862c21540bd8e818 | MATLAB | 1,558 | 44 | function [n, adchans] = plx_ad_chanmap(filename)
% plx_ad_chanmap(filename): return map of raw continuous channel numbers for each channel
% for the specified .plx or .pl2 file
%
% [n, adchans] = plx_ad_chanmap(filename)
%
% INPUT:
% filename - if empty string, will use File Open dialog
%
% OUTPUT:
% n ... |
7f0b07c15ba41fd1c7e02a1a3ccb59918d8310c31108cd9bb770f7c29eb1bfdc | MATLAB | 1,560 | 58 | function im2 = coilCombine( im1 )
% Function: coilCombine
%
% Description: combine multi-coil image sequences
%
% Based on: Walsh DO, Gmitro AF, Marcellin MW. Adaptive reconstruction of
% phased array MR imagery. Magn Reson Med 2000;43:682-690
%
% Parameters:
% im1: the multi-coil images (size [nx,ny,nz,ncoil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.