Commits

Jure Žbontar committed 1db0a4e

Added report.

  • Participants
  • Parent commits 0f1d261

Comments (0)

Files changed (4)

+# Read data stored as a CSR matrix and labels
+from scipy import sparse
+import numpy
+
+def EMC_ReadData( filePath ):
+    """ USAGE:
+        reads a CSR sparse matrix from file and converts it
+        to a Matrix library object in a CSR format
+    
+        PARAMETERS:
+        filePath - full/relative path to the data file
+    """
+    
+    # open file for reading
+    inFile = open(filePath,"r")
+
+    # read matrix shape
+    matrixShape = numpy.fromstring(inFile.readline(),dtype = 'int',sep = ',');
+
+    # read matrix data, indices and indptr
+    data = numpy.fromstring(inFile.readline(),dtype = 'float',sep = ',');
+    indices = numpy.fromstring(inFile.readline(),dtype = 'int',sep = ',');
+    indptr = numpy.fromstring(inFile.readline(),dtype = 'int',sep = ',');
+
+    # close file
+    inFile.close()
+
+    return sparse.csr_matrix((data,indices,indptr),shape = (matrixShape[0],matrixShape[1]))
+
+def EMC_ReadLabels( filePath ):
+    """ USAGE:
+        reads a list of labels into memory
+    
+        PARAMETERS:
+        filePath - full/relative path to the data file
+    
+        RETURN:
+        list of labels
+     """
+
+    # read data from file
+    data = numpy.loadtxt(open(filePath,"r"), dtype='int', delimiter = ",")
+
+    return data
+
+

File report/Makefile

+jzbontar.pdf: jzbontar.tex
+	pdflatex jzbontar.tex
+	pdflatex jzbontar.tex

File report/jzbontar.tex

+\documentclass[a4paper]{article}
+\usepackage[utf8]{inputenc}
+\usepackage{hyperref}
+\usepackage[parfill]{parskip}
+\usepackage{amsfonts}
+\usepackage{amsmath}
+
+\begin{document}
+\title{EMC Israel Data Science Challenge \\
+Team ULjubljana's Solution}
+\author{Members of team ULjubljana\\
+  \texttt{jure.zbontar@fri.uni-lj.si}}
+\date{September 20, 2012}
+\maketitle
+
+\section{Introduction}
+
+We solved the challenge by training a set of base learners
+and combining them whit stacking.
+
+\section{Methods}
+\subsection{Logistic Regression}
+
+\end{document}
+#! /bin/sh -x
+
+#./main.py data
+time ./main.py submit lr 0.04