-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualization.py
More file actions
41 lines (32 loc) · 1.11 KB
/
visualization.py
File metadata and controls
41 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import matplotlib.pyplot as plt
import numpy as np
#----------------------------------------------------------------------------------#
def histogram(observations):
'''
Plots histogram of observations for a given parameter vector
:param observations: parameter vector (list), where each element is an observation
'''
plt.hist(observations)
plt.title("Parameter Clusterization Histogram")
plt.xlabel("Projection onto Factor")
plt.ylabel("Frequency")
plt.show()
#----------------------------------------------------------------------------------#
def scatterplot(X, Y):
'''
Given two factors, plots them as x and y coordinates
:param X:
:param Y:
:return:
'''
plt.scatter(X,Y)
plt.title("Parameter Clusterization Scatterplot")
plt.xlabel("Projection onto Factor 1")
plt.ylabel("Projection onto Factor 2")
plt.show()
#----------------------------------------------------------------------------------#
def visualize(observations, plot="histogram"):
if plot == "histogram":
histogram(observations)
elif plot == "scatterplot":
pass