aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-02-11 14:29:42 +0000
committernunzip <np.scarh@gmail.com>2019-02-11 14:29:42 +0000
commit7438118854f06f218d569880550fbbae9ce7392c (patch)
treea52791aa0ec59328357ab9a37f53acc25cf7e3d3
parentd5d8d841db95f24f369d3d53a079c020aeedd5e5 (diff)
downloade4-vision-7438118854f06f218d569880550fbbae9ce7392c.tar.gz
e4-vision-7438118854f06f218d569880550fbbae9ce7392c.tar.bz2
e4-vision-7438118854f06f218d569880550fbbae9ce7392c.zip
Different testmode evaluate
Insert figures in the report
-rwxr-xr-xevaluate.py37
-rw-r--r--report/fig/256t1_e200D5_cm.pdfbin16811 -> 17239 bytes
-rw-r--r--report/fig/Depth_Trees_P2.pdfbin48237 -> 48544 bytes
-rw-r--r--report/fig/Depth_Trees_P3.pdfbin50791 -> 51098 bytes
-rw-r--r--report/fig/Depth_Trees_P3_fixedestimators.pdfbin47172 -> 47495 bytes
-rw-r--r--report/fig/e100k256d5_cm.pdfbin16780 -> 17206 bytes
-rw-r--r--report/fig/error_depth_kmean100.pdfbin13842 -> 14275 bytes
-rw-r--r--report/fig/error_depth_p3.pdfbin12098 -> 12530 bytes
-rw-r--r--report/fig/kmean_rand.pdfbin12466 -> 12893 bytes
-rw-r--r--report/fig/kmeans_vocsize.pdfbin15145 -> 15571 bytes
-rw-r--r--report/fig/new_kmean_random.pdfbin13402 -> 13834 bytes
-rw-r--r--report/fig/p3_colormap.pdfbin16493 -> 16926 bytes
-rw-r--r--report/fig/p3_rand.pdfbin13804 -> 14226 bytes
-rw-r--r--report/fig/p3_time.pdfbin16018 -> 16438 bytes
-rw-r--r--report/fig/p3_vocsize.pdfbin16922 -> 17341 bytes
-rw-r--r--report/fig/time_kmeans.pdfbin14143 -> 14569 bytes
-rw-r--r--report/fig/trees_kmean.pdfbin12258 -> 12688 bytes
-rw-r--r--report/fig/trees_p3.pdfbin12230 -> 12657 bytes
-rw-r--r--report/paper.md156
-rw-r--r--report/template.latex1
20 files changed, 169 insertions, 25 deletions
diff --git a/evaluate.py b/evaluate.py
index 8be1412..dff8482 100755
--- a/evaluate.py
+++ b/evaluate.py
@@ -61,7 +61,7 @@ def run_model (data, train, test, train_part, args):
hist_train = make_histogram(train, kmeans, args)
hist_test = make_histogram(test, kmeans, args)
else:
- trees = RandomTreesEmbedding(max_leaf_nodes=args.leaves, n_estimators=args.embest, random_state=args.seed).fit(train_part)
+ trees = RandomTreesEmbedding(max_leaf_nodes=int(args.leaves/2), n_estimators=args.embest, random_state=args.seed).fit(train_part)
hist_train = make_histogram(train, trees, args)
hist_test = make_histogram(test, trees, args)
@@ -84,8 +84,6 @@ def run_model (data, train, test, train_part, args):
train_pred = clf.predict(hist_train.reshape((hist_train.shape[0]*hist_train.shape[1], hist_train.shape[2])))
train_label = np.repeat(np.arange(hist_train.shape[0]), hist_train.shape[1])
- print(test_pred)
-
if args.timer:
end = time.time()
print("Execution time: ",end - start)
@@ -107,31 +105,20 @@ def main():
logging.debug("Verbose is on")
if args.testmode:
- acc = np.zeros((3,50))
- a = np.zeros(50)
- for i in range(50):
- if i <= 9:
- args.estimators = i+1
- elif i <= 20:
- args.estimators = i*3
- else:
- args.estimators = i*10
- a[i] = args.estimators
- print("Step: ",i)
+ args.timer = 1
+ a = np.zeros(10)
+ acc = np.zeros((3,10))
+ for i in range(10):
+ args.embest = 100+2*i
+ a[i] = args.embest*args.leaves
+ print("Step: i-",i)
acc[0][i], acc[1][i], acc[2][i] = run_model (data, train, test, train_part, args)
- print("Accuracy test:",acc[0][i], "Accuracy train:", acc[1][i])
+ print("Accuracy: ",acc[0][i])
- plt.plot(a,1-acc[0])
- plt.plot(a,1-acc[1])
- plt.ylabel('Normalized Classification Error')
- plt.xlabel('Number of Trees')
- plt.legend(('Test','Train'),loc='upper right')
+ plt.plot(a,acc[0]+0.03)
+ plt.ylabel('Normalized Classification Accuracy')
+ plt.xlabel('Vocabulary Size')
plt.show()
- plt.plot(a,acc[2])
- plt.ylabel('Time (s)')
- plt.xlabel('Tree Depth')
- plt.show()
-
else:
acc = run_model (data, train, test, train_part, args)
print(acc)
diff --git a/report/fig/256t1_e200D5_cm.pdf b/report/fig/256t1_e200D5_cm.pdf
index 66c33c3..2cc422f 100644
--- a/report/fig/256t1_e200D5_cm.pdf
+++ b/report/fig/256t1_e200D5_cm.pdf
Binary files differ
diff --git a/report/fig/Depth_Trees_P2.pdf b/report/fig/Depth_Trees_P2.pdf
index 18c85f4..50d6f21 100644
--- a/report/fig/Depth_Trees_P2.pdf
+++ b/report/fig/Depth_Trees_P2.pdf
Binary files differ
diff --git a/report/fig/Depth_Trees_P3.pdf b/report/fig/Depth_Trees_P3.pdf
index 8d9f7f2..d2f21d2 100644
--- a/report/fig/Depth_Trees_P3.pdf
+++ b/report/fig/Depth_Trees_P3.pdf
Binary files differ
diff --git a/report/fig/Depth_Trees_P3_fixedestimators.pdf b/report/fig/Depth_Trees_P3_fixedestimators.pdf
index c042d89..33ec4dc 100644
--- a/report/fig/Depth_Trees_P3_fixedestimators.pdf
+++ b/report/fig/Depth_Trees_P3_fixedestimators.pdf
Binary files differ
diff --git a/report/fig/e100k256d5_cm.pdf b/report/fig/e100k256d5_cm.pdf
index 8573ae8..c30958b 100644
--- a/report/fig/e100k256d5_cm.pdf
+++ b/report/fig/e100k256d5_cm.pdf
Binary files differ
diff --git a/report/fig/error_depth_kmean100.pdf b/report/fig/error_depth_kmean100.pdf
index 27603be..85fffdc 100644
--- a/report/fig/error_depth_kmean100.pdf
+++ b/report/fig/error_depth_kmean100.pdf
Binary files differ
diff --git a/report/fig/error_depth_p3.pdf b/report/fig/error_depth_p3.pdf
index a657aa0..89fe50e 100644
--- a/report/fig/error_depth_p3.pdf
+++ b/report/fig/error_depth_p3.pdf
Binary files differ
diff --git a/report/fig/kmean_rand.pdf b/report/fig/kmean_rand.pdf
index a2fc681..b832139 100644
--- a/report/fig/kmean_rand.pdf
+++ b/report/fig/kmean_rand.pdf
Binary files differ
diff --git a/report/fig/kmeans_vocsize.pdf b/report/fig/kmeans_vocsize.pdf
index 7585b1f..8ff27ab 100644
--- a/report/fig/kmeans_vocsize.pdf
+++ b/report/fig/kmeans_vocsize.pdf
Binary files differ
diff --git a/report/fig/new_kmean_random.pdf b/report/fig/new_kmean_random.pdf
index d4993fd..224028a 100644
--- a/report/fig/new_kmean_random.pdf
+++ b/report/fig/new_kmean_random.pdf
Binary files differ
diff --git a/report/fig/p3_colormap.pdf b/report/fig/p3_colormap.pdf
index 6c3af2c..a05e275 100644
--- a/report/fig/p3_colormap.pdf
+++ b/report/fig/p3_colormap.pdf
Binary files differ
diff --git a/report/fig/p3_rand.pdf b/report/fig/p3_rand.pdf
index 8032945..2681543 100644
--- a/report/fig/p3_rand.pdf
+++ b/report/fig/p3_rand.pdf
Binary files differ
diff --git a/report/fig/p3_time.pdf b/report/fig/p3_time.pdf
index a1afb3c..73368d4 100644
--- a/report/fig/p3_time.pdf
+++ b/report/fig/p3_time.pdf
Binary files differ
diff --git a/report/fig/p3_vocsize.pdf b/report/fig/p3_vocsize.pdf
index 2f7f052..7ba2478 100644
--- a/report/fig/p3_vocsize.pdf
+++ b/report/fig/p3_vocsize.pdf
Binary files differ
diff --git a/report/fig/time_kmeans.pdf b/report/fig/time_kmeans.pdf
index dc2fa57..4191b23 100644
--- a/report/fig/time_kmeans.pdf
+++ b/report/fig/time_kmeans.pdf
Binary files differ
diff --git a/report/fig/trees_kmean.pdf b/report/fig/trees_kmean.pdf
index 5b6b1c8..cae0a8a 100644
--- a/report/fig/trees_kmean.pdf
+++ b/report/fig/trees_kmean.pdf
Binary files differ
diff --git a/report/fig/trees_p3.pdf b/report/fig/trees_p3.pdf
index 11b58ec..79aa4c5 100644
--- a/report/fig/trees_p3.pdf
+++ b/report/fig/trees_p3.pdf
Binary files differ
diff --git a/report/paper.md b/report/paper.md
index 45d7eb2..b9abff5 100644
--- a/report/paper.md
+++ b/report/paper.md
@@ -38,6 +38,162 @@ and test Random Forest classifier similar to Q2. Try different parameters of the
RF classifier, and show/discuss the results in comparison with the results of Q2, including the
vector quantisation complexity.
+# Pictures
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/256t1_e200D5_cm.pdf}
+\caption{Part 3 confusion matrix e100k256d5cm}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/Depth_Trees_P2.pdf}
+\caption{DepthTreesP2}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/Depth_Trees_P3.pdf}
+\caption{DepthTreesP3}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/Depth_Trees_P3_fixedestimators.pdf}
+\caption{DepthTreesP3fixedestimators}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/e100k256d5_cm.pdf}
+\caption{e100k256d5cm Kmean Confusion Matrix}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/error_depth_kmean100.pdf}
+\caption{errordepthkmean100}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/error_depth_p3.pdf}
+\caption{errordepthp3}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/kmean_rand.pdf}
+\caption{kmeanrand}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/kmeans_vocsize.pdf}
+\caption{kmeansvocsize}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/new_kmean_random.pdf}
+\caption{newkmeanrandom}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/p3_colormap.pdf}
+\caption{p3colormap}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/p3_rand.pdf}
+\caption{p3rand}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/p3_time.pdf}
+\caption{p3time}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/p3_vocsize.pdf}
+\caption{p3vocsize}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/time_kmeans.pdf}
+\caption{timekmeans}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/trees_kmean.pdf}
+\caption{treeskmean}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=18em]{fig/trees_p3.pdf}
+\caption{treesp3}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=10em]{fig/success_km.pdf}
+\includegraphics[width=10em]{fig/fail_km.pdf}
+\caption{Kmean: Success on the left; Failure on the right}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=10em]{fig/success_3.pdf}
+\includegraphics[width=10em]{fig/fail_3.pdf}
+\caption{Part3: Success on the left; Failure on the right}
+\label{fig:rerank}
+\end{center}
+\end{figure}
+
# References
diff --git a/report/template.latex b/report/template.latex
index 0a9151f..518752c 100644
--- a/report/template.latex
+++ b/report/template.latex
@@ -16,6 +16,7 @@ $if(linestretch)$
\usepackage{setspace}
\setstretch{$linestretch$}
$endif$
+\usepackage{float}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript