Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
java-wowa-training
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
java-wowa-training
Commits
ec7996bc
Commit
ec7996bc
authored
5 years ago
by
a.croix
Browse files
Options
Downloads
Patches
Plain Diff
Add new Main function for new Dataset
parent
4f9392eb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3189
failed
5 years ago
Stage: leaks
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/be/cylab/java/wowa/training/Icmcis.java
+69
-0
69 additions, 0 deletions
src/main/java/be/cylab/java/wowa/training/Icmcis.java
with
69 additions
and
0 deletions
src/main/java/be/cylab/java/wowa/training/Icmcis.java
0 → 100644
+
69
−
0
View file @
ec7996bc
package
be.cylab.java.wowa.training
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.SimpleFormatter
;
import
java.util.logging.StreamHandler
;
public
class
Icmcis
{
public
static
void
main
(
final
String
[]
args
)
{
int
population_size
=
Integer
.
parseInt
(
args
[
0
]);
int
crossover_rate
=
Integer
.
parseInt
(
args
[
1
]);
int
mutation_rate
=
Integer
.
parseInt
(
args
[
2
]);
int
max_generation_number
=
Integer
.
parseInt
(
args
[
3
]);
int
selection_method
;
if
(
args
[
4
].
matches
(
"RWS"
))
{
selection_method
=
TrainerParameters
.
SELECTION_METHOD_RWS
;
}
else
if
(
args
[
4
].
matches
(
"TOS"
))
{
selection_method
=
TrainerParameters
.
SELECTION_METHOD_TOS
;
}
else
{
throw
new
IllegalArgumentException
(
"Selection method must be RWS ar TOS"
);
}
int
generation_population_method
;
if
(
args
[
5
].
matches
(
"RANDOM"
))
{
generation_population_method
=
TrainerParameters
.
POPULATION_INITIALIZATION_RANDOM
;
}
else
if
(
args
[
5
].
matches
(
"QUASI_RANDOM"
))
{
generation_population_method
=
TrainerParameters
.
POPULATION_INITIALIZATION_QUASI_RANDOM
;
}
else
{
throw
new
IllegalArgumentException
(
"Initialization must be RANDOM or QUASI_RANDOM"
);
}
String
solution_type
=
args
[
6
];
AbstractSolution
sol_type
=
null
;
if
(
solution_type
.
matches
(
"DISTANCE"
))
{
sol_type
=
new
SolutionDistance
(
16
);
}
else
if
(
solution_type
.
matches
(
"AUC"
))
{
sol_type
=
new
SolutionAUC
(
16
);
}
else
{
throw
new
IllegalArgumentException
(
"Solution type must be Distance or AUC"
);
}
String
data_file
=
"./ressources/ratio_train.csv"
;
String
expected_file
=
"./ressources/Label.csv"
;
Logger
logger
=
Logger
.
getLogger
(
Trainer
.
class
.
getName
());
logger
.
setLevel
(
Level
.
INFO
);
StreamHandler
handler
=
new
StreamHandler
(
System
.
out
,
new
SimpleFormatter
());
logger
.
addHandler
(
handler
);
TrainerParameters
parameters
=
new
TrainerParameters
(
logger
,
population_size
,
crossover_rate
,
mutation_rate
,
max_generation_number
,
selection_method
,
generation_population_method
);
Trainer
trainer
=
new
Trainer
(
parameters
,
sol_type
);
AbstractSolution
result
=
trainer
.
runCSV
(
data_file
,
expected_file
);
System
.
out
.
println
(
result
);
}
}
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