Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Function help/comments edited.
  • Loading branch information
snikumbh committed Jul 30, 2017
1 parent cf9fa31 commit 0166c98
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
2 changes: 1 addition & 1 deletion comik_main_with_weight_vector.m
Expand Up @@ -490,7 +490,7 @@
%
heatmapFname = strcat(outputFolder,'/Heatmap-InstanceWeights', '_oligoLen', num2str(oligoLen), '_segmentSize', num2str(segmentSizeInBps) , '_maxDist', num2str(maxDist), '_nClusters', num2str(bestParamComb.best_nClusters), '_svmC', num2str(bestParamComb.best_C) ,'_sigma', num2str(bestParamComb.best_sigma), '.pdf');
%
p = plot_heatmap(normInstanceWeightsInEachBag, heatmapFname, 0, 1);
p = plotHeatmap(normInstanceWeightsInEachBag, heatmapFname, 0, 1);
logMessages(debugMsgLocation,sprintf('done!\n'), debugLevel);
%
end
Expand Down
9 changes: 5 additions & 4 deletions libsvm_plotroc.m
@@ -1,10 +1,11 @@
function [auROC auPRC] = plotroc(y,x,params)
%plotroc draws the recevier operating characteristic(ROC) curve.
% Reused and adapted from the Matlab code of LIBSVM.
% plotroc draws the recevier operating characteristic(ROC) curve.
%
%auc = plotroc(training_label, training_instance [, libsvm_options -v cv_fold])
% auc = plotroc(training_label, training_instance [, libsvm_options -v cv_fold])
% Use cross-validation on training data to get decision values and plot ROC curve.
%
%auc = plotroc(testing_label, testing_instance, model)
% auc = plotroc(testing_label, testing_instance, model)
% Use the given model to predict testing data and obtain decision values
% for ROC
%
Expand All @@ -16,6 +17,7 @@
% [y,x] = libsvmread('heart_scale');
% model = svmtrain(y,x);
% plotroc(y,x,model);

rand('state',0); % reset random seed
if nargin < 2
help plotroc
Expand All @@ -29,7 +31,6 @@
[predict_label,mse,deci] = libsvmpredict(y,x,model); % the procedure for predicting
[auROC auPRC] = roc_curve(deci*model.Label(1),y);
elseif exist('params') && strcmp(params, 'personal')
%disp('Personal auROC');
[auROC auPRC] = roc_curve(x, y);
[prc_stack_x, prc_stack_y, prc_thre, auPRC] = perfcurve(y, x, 1, 'xCrit', 'reca', 'yCrit', 'prec');
%% This condition takes care of scenario when
Expand Down
19 changes: 19 additions & 0 deletions logMessages.m
@@ -1,5 +1,24 @@
function logMessages(fid, statement, debugLevel)

% LOGMESSAGES
% Prints out log messages for CoMIK
%
% INPUT PARAMS
% Param 'fid'
%
%
% Param 'statement'
%
%
% Param 'debugLevel'
%
% ADDITIONAL NOTES
% debugLevel 2 prints all messages
% debugLevel 1 place holder level, may be used in the future
% debugLevel 0 silent on most of the messages, prints very few messages for the user
%
% Author: snikumbh@mpi-inf.mpg.de

if debugLevel == 2
fprintf(fid, statement); %when fid is 1, this prints to command window
end
Expand Down
15 changes: 10 additions & 5 deletions mkl.py
@@ -1,5 +1,14 @@
#!/usr/bin/env python

# This python script performs MKL for CoMIK
#
# ADDITIONAL NOTES
# We will read kernel_files from disk
# C will be a passed argument
#
# Author: snikumbh@mpi-inf.mpg.de


#system imports
from optparse import OptionParser, OptionGroup, OptionValueError
import numpy, sys, os
Expand All @@ -16,9 +25,6 @@
print "Refer to instructions on http://www.shogun-toolbox.org/ for installing SHOGUN with the python_modular interface."
raise

# will read kernel_files from disk
# C will be a passed argument
#

parser = OptionParser()

Expand Down Expand Up @@ -54,7 +60,6 @@
trainlabels = BinaryLabels(numpy.array(trainlabels))

# assemble combined kernel

with open(options.trainkernelsListFilename, 'r') as f:
kernelFilenames = [fl.rstrip() for fl in f.readlines()]

Expand All @@ -67,7 +72,7 @@
else:
raise OptionValueError("Cannot open %s as a file. Please check if it exists." % thisFname)

#trainkernel.set_normalizer(SqrtDiagKernelNormalizer(True))
# trainkernel.set_normalizer(SqrtDiagKernelNormalizer(True))
# train MKL
mkl = MKLClassification(LibSVM())

Expand Down

0 comments on commit 0166c98

Please sign in to comment.