Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Supervised-Learning-Challenge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SAINI Shikhar
Supervised-Learning-Challenge
Commits
12e2b346
Commit
12e2b346
authored
2 years ago
by
sr1009
Browse files
Options
Downloads
Patches
Plain Diff
commit
parent
294750ce
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code.ipynb
+265
-0
265 additions, 0 deletions
Code.ipynb
with
265 additions
and
0 deletions
Code.ipynb
0 → 100644
+
265
−
0
View file @
12e2b346
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import os\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"path = 'HGS/3213/'\n",
"directories = os.listdir(path)\n",
"columns = ['s'+str(i) for i in range(1,19)]\n",
"columns = ['instance','cost_solution'] + columns"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>instance</th>\n",
" <th>cost_solution</th>\n",
" <th>s1</th>\n",
" <th>s2</th>\n",
" <th>s3</th>\n",
" <th>s4</th>\n",
" <th>s5</th>\n",
" <th>s6</th>\n",
" <th>s7</th>\n",
" <th>s8</th>\n",
" <th>s9</th>\n",
" <th>s10</th>\n",
" <th>s11</th>\n",
" <th>s12</th>\n",
" <th>s13</th>\n",
" <th>s14</th>\n",
" <th>s15</th>\n",
" <th>s16</th>\n",
" <th>s17</th>\n",
" <th>s18</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>XML100_3213_01</td>\n",
" <td>22793</td>\n",
" <td>136.101</td>\n",
" <td>93.2145</td>\n",
" <td>0.0566</td>\n",
" <td>0.0419</td>\n",
" <td>987.636</td>\n",
" <td>342.830</td>\n",
" <td>0</td>\n",
" <td>847.909</td>\n",
" <td>0.3881</td>\n",
" <td>0.1454</td>\n",
" <td>1421.36</td>\n",
" <td>0.3657</td>\n",
" <td>0.1828</td>\n",
" <td>0.2584</td>\n",
" <td>696.380</td>\n",
" <td>506.898</td>\n",
" <td>2.5745</td>\n",
" <td>5.2841</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>XML100_3213_01</td>\n",
" <td>22504</td>\n",
" <td>180.084</td>\n",
" <td>110.4310</td>\n",
" <td>0.0712</td>\n",
" <td>0.0528</td>\n",
" <td>1055.800</td>\n",
" <td>296.176</td>\n",
" <td>0</td>\n",
" <td>902.200</td>\n",
" <td>0.3873</td>\n",
" <td>0.1777</td>\n",
" <td>1358.10</td>\n",
" <td>0.2000</td>\n",
" <td>0.1000</td>\n",
" <td>0.0000</td>\n",
" <td>613.798</td>\n",
" <td>462.556</td>\n",
" <td>0.0000</td>\n",
" <td>6.7722</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>XML100_3213_01</td>\n",
" <td>21594</td>\n",
" <td>233.753</td>\n",
" <td>189.6580</td>\n",
" <td>0.0967</td>\n",
" <td>0.0878</td>\n",
" <td>986.200</td>\n",
" <td>361.022</td>\n",
" <td>0</td>\n",
" <td>818.400</td>\n",
" <td>0.3592</td>\n",
" <td>0.1083</td>\n",
" <td>1472.60</td>\n",
" <td>0.2000</td>\n",
" <td>0.1000</td>\n",
" <td>0.0000</td>\n",
" <td>753.834</td>\n",
" <td>484.767</td>\n",
" <td>0.0000</td>\n",
" <td>5.5556</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>XML100_3213_01</td>\n",
" <td>22866</td>\n",
" <td>107.146</td>\n",
" <td>45.6872</td>\n",
" <td>0.0567</td>\n",
" <td>0.0560</td>\n",
" <td>1002.450</td>\n",
" <td>340.854</td>\n",
" <td>0</td>\n",
" <td>826.818</td>\n",
" <td>0.3789</td>\n",
" <td>0.1060</td>\n",
" <td>1483.09</td>\n",
" <td>0.3657</td>\n",
" <td>0.1828</td>\n",
" <td>0.2584</td>\n",
" <td>682.954</td>\n",
" <td>516.207</td>\n",
" <td>2.5745</td>\n",
" <td>5.0379</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>XML100_3213_01</td>\n",
" <td>22756</td>\n",
" <td>150.963</td>\n",
" <td>97.8176</td>\n",
" <td>0.0596</td>\n",
" <td>0.0459</td>\n",
" <td>976.273</td>\n",
" <td>339.827</td>\n",
" <td>0</td>\n",
" <td>834.636</td>\n",
" <td>0.3861</td>\n",
" <td>0.1338</td>\n",
" <td>1427.09</td>\n",
" <td>0.3657</td>\n",
" <td>0.1828</td>\n",
" <td>0.2584</td>\n",
" <td>697.418</td>\n",
" <td>507.348</td>\n",
" <td>2.5745</td>\n",
" <td>5.0360</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" instance cost_solution s1 s2 s3 s4 s5 \\\n",
"0 XML100_3213_01 22793 136.101 93.2145 0.0566 0.0419 987.636 \n",
"1 XML100_3213_01 22504 180.084 110.4310 0.0712 0.0528 1055.800 \n",
"2 XML100_3213_01 21594 233.753 189.6580 0.0967 0.0878 986.200 \n",
"3 XML100_3213_01 22866 107.146 45.6872 0.0567 0.0560 1002.450 \n",
"4 XML100_3213_01 22756 150.963 97.8176 0.0596 0.0459 976.273 \n",
"\n",
" s6 s7 s8 s9 s10 s11 s12 s13 s14 \\\n",
"0 342.830 0 847.909 0.3881 0.1454 1421.36 0.3657 0.1828 0.2584 \n",
"1 296.176 0 902.200 0.3873 0.1777 1358.10 0.2000 0.1000 0.0000 \n",
"2 361.022 0 818.400 0.3592 0.1083 1472.60 0.2000 0.1000 0.0000 \n",
"3 340.854 0 826.818 0.3789 0.1060 1483.09 0.3657 0.1828 0.2584 \n",
"4 339.827 0 834.636 0.3861 0.1338 1427.09 0.3657 0.1828 0.2584 \n",
"\n",
" s15 s16 s17 s18 \n",
"0 696.380 506.898 2.5745 5.2841 \n",
"1 613.798 462.556 0.0000 6.7722 \n",
"2 753.834 484.767 0.0000 5.5556 \n",
"3 682.954 516.207 2.5745 5.0379 \n",
"4 697.418 507.348 2.5745 5.0360 "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dfs = [pd.read_csv(path + i, sep=';',names = columns) for i in directories]\n",
"df = pd.concat(dfs)\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.8 ('base')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "ac84c186c3977d3f3331649749bf53276a5c5befb029be0bc359ac378ed9e33b"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
%% Cell type:code id: tags:
```
python
import
pandas
as
pd
import
os
import
numpy
as
np
import
matplotlib.pyplot
as
plt
%
matplotlib
inline
```
%% Cell type:code id: tags:
```
python
path
=
'
HGS/3213/
'
directories
=
os
.
listdir
(
path
)
columns
=
[
'
s
'
+
str
(
i
)
for
i
in
range
(
1
,
19
)]
columns
=
[
'
instance
'
,
'
cost_solution
'
]
+
columns
```
%% Cell type:code id: tags:
```
python
dfs
=
[
pd
.
read_csv
(
path
+
i
,
sep
=
'
;
'
,
names
=
columns
)
for
i
in
directories
]
df
=
pd
.
concat
(
dfs
)
df
.
head
()
```
%% Output
instance cost_solution s1 s2 s3 s4 s5 \
0 XML100_3213_01 22793 136.101 93.2145 0.0566 0.0419 987.636
1 XML100_3213_01 22504 180.084 110.4310 0.0712 0.0528 1055.800
2 XML100_3213_01 21594 233.753 189.6580 0.0967 0.0878 986.200
3 XML100_3213_01 22866 107.146 45.6872 0.0567 0.0560 1002.450
4 XML100_3213_01 22756 150.963 97.8176 0.0596 0.0459 976.273
s6 s7 s8 s9 s10 s11 s12 s13 s14 \
0 342.830 0 847.909 0.3881 0.1454 1421.36 0.3657 0.1828 0.2584
1 296.176 0 902.200 0.3873 0.1777 1358.10 0.2000 0.1000 0.0000
2 361.022 0 818.400 0.3592 0.1083 1472.60 0.2000 0.1000 0.0000
3 340.854 0 826.818 0.3789 0.1060 1483.09 0.3657 0.1828 0.2584
4 339.827 0 834.636 0.3861 0.1338 1427.09 0.3657 0.1828 0.2584
s15 s16 s17 s18
0 696.380 506.898 2.5745 5.2841
1 613.798 462.556 0.0000 6.7722
2 753.834 484.767 0.0000 5.5556
3 682.954 516.207 2.5745 5.0379
4 697.418 507.348 2.5745 5.0360
%% Cell type:code id: tags:
```
python
```
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