Plot the 100 jobs.
This commit is contained in:
parent
343b77a036
commit
138cdaa363
|
@ -6,12 +6,13 @@ from pandas import DataFrame
|
||||||
from pandas import Grouper
|
from pandas import Grouper
|
||||||
from matplotlib import pyplot
|
from matplotlib import pyplot
|
||||||
|
|
||||||
jobs = sys.argv[1:]
|
jobs = [sys.argv[1]]
|
||||||
|
prefix = sys.argv[2]
|
||||||
|
|
||||||
print("Analyzing the jobs: " + str(jobs))
|
print("Plotting the job: " + str(jobs))
|
||||||
|
|
||||||
# Plot the timeseries
|
# Plot the timeseries
|
||||||
def plot(header, row):
|
def plot(prefix, header, row):
|
||||||
x = { h : d for (h, d) in zip(header, row)}
|
x = { h : d for (h, d) in zip(header, row)}
|
||||||
jobid = x["jobid"]
|
jobid = x["jobid"]
|
||||||
del x["jobid"]
|
del x["jobid"]
|
||||||
|
@ -40,7 +41,7 @@ def plot(header, row):
|
||||||
ax[i].set_ylabel(l)
|
ax[i].set_ylabel(l)
|
||||||
|
|
||||||
pyplot.xlabel("Segment number")
|
pyplot.xlabel("Segment number")
|
||||||
pyplot.savefig("timeseries" + jobid + ".png")
|
pyplot.savefig(prefix + "timeseries" + jobid + ".png")
|
||||||
|
|
||||||
# Plot first 30 minutes
|
# Plot first 30 minutes
|
||||||
|
|
||||||
|
@ -49,8 +50,9 @@ def plot(header, row):
|
||||||
ax[i].set_ylabel(l)
|
ax[i].set_ylabel(l)
|
||||||
|
|
||||||
pyplot.xlabel("Segment number")
|
pyplot.xlabel("Segment number")
|
||||||
pyplot.savefig("timeseries" + jobid + "-30.png")
|
pyplot.savefig(prefix + "timeseries" + jobid + "-30.png")
|
||||||
|
|
||||||
|
### end plotting function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,4 +68,4 @@ with open('job-io-datasets/datasets/job_codings.csv') as csv_file:
|
||||||
if not row[0].strip() in jobs:
|
if not row[0].strip() in jobs:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
plot(header, row)
|
plot(prefix, header, row)
|
||||||
|
|
|
@ -50,6 +50,14 @@ plotJobs = function(jobs){
|
||||||
#print(tbl)
|
#print(tbl)
|
||||||
md = metadata[metadata$jobid %in% jobs,]
|
md = metadata[metadata$jobid %in% jobs,]
|
||||||
print(summary(md))
|
print(summary(md))
|
||||||
|
|
||||||
|
# print the job timeline
|
||||||
|
r = e[ordered, ]
|
||||||
|
for (row in 1:length(jobs)) {
|
||||||
|
prefix = sprintf("%s-%f-%.0f", level, r[row, "similarity"], row)
|
||||||
|
job = r[row, "jobid"]
|
||||||
|
system(sprintf("scripts/plot-single-job.py %s %s", job, prefix))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Store the job ids in a table, each column is one algorithm
|
# Store the job ids in a table, each column is one algorithm
|
||||||
|
|
Loading…
Reference in New Issue