Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
compsys-coursework2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
bav1g20
compsys-coursework2
Commits
46060854
Commit
46060854
authored
2 years ago
by
Andrei Vasile
Browse files
Options
Downloads
Patches
Plain Diff
Updated result saving as per requirements
parent
8900fcaf
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
src/main.py
+8
-6
8 additions, 6 deletions
src/main.py
with
8 additions
and
6 deletions
src/main.py
+
8
−
6
View file @
46060854
from
pathlib
import
Path
from
pathlib
import
Path
from
pandas
import
read_csv
from
pandas
import
read_csv
,
DataFrame
from
autogluon.tabular
import
TabularDataset
,
TabularPredictor
from
autogluon.tabular
import
TabularDataset
,
TabularPredictor
from
datetime
import
datetime
from
datetime
import
datetime
...
@@ -53,9 +53,9 @@ def handlePredict(ds):
...
@@ -53,9 +53,9 @@ def handlePredict(ds):
def
predict
(
ds
,
model
):
def
predict
(
ds
,
model
):
root
=
Path
(
__file__
).
parent
.
parent
root
=
Path
(
__file__
).
parent
.
parent
testing
=
root
/
"
resources
"
/
f
"
Testing
{
d
ata
sets
[
ds
]
}
.csv
"
testing
=
root
/
"
resources
"
/
"
Testing
D
ata
{}.csv
"
.
format
(
"
Multi
"
if
ds
==
'
b
'
else
"
Binary
"
)
testingData
=
read_csv
(
testing
,
header
=
None
)
testingData
=
read_csv
(
testing
,
header
=
None
)
savePath
=
root
/
"
output
"
/
f
"
Testing
{
datasets
[
ds
]
}
.csv
"
savePath
=
root
/
"
output
"
/
"
Testing
Results{}.csv
"
.
format
(
"
Multi
"
if
ds
==
'
b
'
else
"
Binary
"
)
predictor
=
TabularPredictor
.
load
(
path
=
model
)
predictor
=
TabularPredictor
.
load
(
path
=
model
)
...
@@ -63,10 +63,12 @@ def predict(ds, model):
...
@@ -63,10 +63,12 @@ def predict(ds, model):
testingData
[
128
]
=
a
testingData
[
128
]
=
a
print
(
a
)
print
(
a
)
a
=
savePath
.
absolute
().
as_posix
()
savePath
=
savePath
.
absolute
().
as_posix
()
print
(
f
"
Saving to
{
a
}
"
)
print
(
f
"
Saving to
{
savePath
}
"
)
testingData
.
to_csv
(
path_or_buf
=
a
,
header
=
False
)
with
open
(
savePath
,
"
w
"
)
as
f
:
for
i
in
a
:
f
.
write
(
f
"
{
i
}
\n
"
)
def
handleTrain
(
ds
):
def
handleTrain
(
ds
):
print
(
"
Starting training
"
)
print
(
"
Starting training
"
)
...
...
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