Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
214500a0
Commit
214500a0
authored
2 months ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Update Jupyter notebooks and dependencies
parent
279b98df
No related branches found
No related tags found
No related merge requests found
Pipeline
#17219
skipped
Stage: build
Stage: test
Stage: check
Stage: deploy
Stage: smoketest
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
analysis/Dockerfile
+1
-1
1 addition, 1 deletion
analysis/Dockerfile
analysis/README.md
+3
-4
3 additions, 4 deletions
analysis/README.md
analysis/lag-trend-graph.ipynb
+13
-13
13 additions, 13 deletions
analysis/lag-trend-graph.ipynb
analysis/requirements.txt
+4
-4
4 additions, 4 deletions
analysis/requirements.txt
with
21 additions
and
22 deletions
analysis/Dockerfile
+
1
−
1
View file @
214500a0
FROM
jupyter/base-notebook:python-3.
8
FROM
jupyter/base-notebook:python-3.
10
COPY
. /home/jovyan
...
...
This diff is collapsed.
Click to expand it.
analysis/README.md
+
3
−
4
View file @
214500a0
...
...
@@ -19,9 +19,8 @@ In general, the Theodolite Analysis Jupyter notebooks should be runnable by any
we provide introductions for running notebooks with Docker and with Visual Studio Code. These intoduction may also be
a good starting point for using another service.
For analyzing and visualizing benchmark results, either Docker or a Jupyter installation with Python 3.7 or 3.8 is
required (e.g., in a virtual environment).
**
Please note that Python 3.9 seems not to be working as not all our
dependencies are ported to Python 3.9 yet.
**
For analyzing and visualizing benchmark results, either Docker or a Jupyter installation with Python 3.10 is
required (e.g., in a virtual environment).
### Running with Docker
...
...
@@ -39,7 +38,7 @@ docker run --rm -p 8888:8888 -v "$PWD/../results":/home/jovyan/results -v "$PWD/
### Running with Visual Studio Code
The
[
Visual Studio Code Documentation
](
https://code.visualstudio.com/docs/python/jupyter-support
)
shows to run Jupyter
notebooks with Visual Studio Code. For our notebooks, Python 3.
7
or newer is required (e.g., in a virtual environment).
notebooks with Visual Studio Code. For our notebooks, Python 3.
10
or newer is required (e.g., in a virtual environment).
Moreover, they require some Python libraries, which can be installed by:
```
sh
...
...
This diff is collapsed.
Click to expand it.
analysis/lag-trend-graph.ipynb
+
13
−
13
View file @
214500a0
...
...
@@ -46,8 +46,8 @@
"#input.plot(kind='line',x='timestamp',y='value',color='red')\n",
"#plt.show()\n",
"\n",
"X = regress.iloc[:,
4
].values.reshape(-1, 1) # values converts it into a numpy array\n",
"Y = regress.iloc[:,
3
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n",
"X = regress.iloc[:,
3
].values.reshape(-1, 1) # values converts it into a numpy array\n",
"Y = regress.iloc[:,
2
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column\n",
"linear_regressor = LinearRegression() # create object for the class\n",
"linear_regressor.fit(X, Y) # perform linear regression\n",
"Y_pred = linear_regressor.predict(X) # make predictions"
...
...
@@ -84,8 +84,8 @@
"#filename = f\"exp{exp_id}_{benchmark}_{dim_value}_{instances}\"\n",
"\n",
"\n",
"t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
4
].values\n",
"y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values\n",
"t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values\n",
"y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
2
].values\n",
"\n",
"plt.figure()\n",
"#plt.figure(figsize=(4, 3))\n",
...
...
@@ -109,26 +109,26 @@
}
],
"metadata": {
"file_extension": ".py",
"kernelspec": {
"display_name": "Python 3.7.0 64-bit ('.venv': venv)",
"name": "python37064bitvenvvenv21b61136d7f443749f2918b47e00d223"
},
"language_info": {
"name": "python",
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"name": "python",
"version": "3.7.0-final"
},
"orig_nbformat": 2,
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"npconvert_exporter": "python",
"orig_nbformat": 2,
"pygments_lexer": "ipython3",
"version": 3,
"kernelspec": {
"name": "python37064bitvenvvenv21b61136d7f443749f2918b47e00d223",
"display_name": "Python 3.7.0 64-bit ('.venv': venv)"
}
"version": 3
},
"nbformat": 4,
"nbformat_minor": 2
}
\ No newline at end of file
}
%% Cell type:code id: tags:
```
import os
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
import matplotlib
```
%% Cell type:code id: tags:
```
directory = '<path-to>/results'
#filename = 'exp1002_uc3_75000_1_totallag.csv'
filename = 'exp1002_uc3_50000_2_totallag.csv'
warmup_sec = 60
threshold = 2000 #slope
```
%% Cell type:code id: tags:
```
df = pd.read_csv(os.path.join(directory, filename))
input = df.iloc[::3]
#print(input)
input['sec_start'] = input.loc[0:, 'timestamp'] - input.iloc[0]['timestamp']
#print(input)
#print(input.iloc[0, 'timestamp'])
regress = input.loc[input['sec_start'] >= warmup_sec] # Warm-Up
#regress = input
#input.plot(kind='line',x='timestamp',y='value',color='red')
#plt.show()
X = regress.iloc[:,
4
].values.reshape(-1, 1) # values converts it into a numpy array
Y = regress.iloc[:,
3
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column
X = regress.iloc[:,
3
].values.reshape(-1, 1) # values converts it into a numpy array
Y = regress.iloc[:,
2
].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column
linear_regressor = LinearRegression() # create object for the class
linear_regressor.fit(X, Y) # perform linear regression
Y_pred = linear_regressor.predict(X) # make predictions
```
%% Cell type:code id: tags:
```
print(linear_regressor.coef_)
```
%% Cell type:code id: tags:
```
plt.style.use('ggplot')
plt.rcParams['axes.facecolor']='w'
plt.rcParams['axes.edgecolor']='555555'
#plt.rcParams['ytick.color']='black'
plt.rcParams['grid.color']='dddddd'
plt.rcParams['axes.spines.top']='false'
plt.rcParams['axes.spines.right']='false'
plt.rcParams['legend.frameon']='true'
plt.rcParams['legend.framealpha']='1'
plt.rcParams['legend.edgecolor']='1'
plt.rcParams['legend.borderpad']='1'
#filename = f"exp{exp_id}_{benchmark}_{dim_value}_{instances}"
t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
4
].values
y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values
t_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
3
].values
y_warmup = input.loc[input['sec_start'] <= warmup_sec].iloc[:,
2
].values
plt.figure()
#plt.figure(figsize=(4, 3))
plt.plot(X, Y, c="#348ABD", label="observed")
#plt.plot(t_warmup, y_warmup)
plt.plot(X, Y_pred, c="#E24A33", label="trend") # color='red')
#348ABD, 7A68A6, A60628, 467821, CF4457, 188487, E24A33
plt.gca().yaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, pos: '%1.0fK' % (x * 1e-3)))
plt.ylabel('queued messages')
plt.xlabel('seconds since start')
plt.legend()
#ax.set_ylim(ymin=0)
#ax.set_xlim(xmin=0)
plt.savefig("plot.pdf", bbox_inches='tight')
```
...
...
This diff is collapsed.
Click to expand it.
analysis/requirements.txt
+
4
−
4
View file @
214500a0
jupyter==1.
0.0
matplotlib==3.
2
.0
pandas==
1.0.1
jupyter==1.
1.1
matplotlib==3.
10
.0
pandas==
2.2.3
scikit-learn==1.0.2
numpy==1.2
3.1
numpy==1.2
6.4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment