Skip to content

Commit

Permalink
Added new config file
Browse files Browse the repository at this point in the history
  • Loading branch information
makgyver committed Mar 6, 2019
1 parent 2f0024d commit a2a799f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions PRL/prl.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@ def fit(self, iterations=1000, verbose=False):


def predict(self, gen_pref_test):
"""Computes the classification for the given test preferences.
:param gen_pref_test: test preference generator
:type gen_pref_test: object of class which inherits from <:genP.GenP>, e.g., GenMacroP
:returns: a vector containing the predictions
:rtype: numpy.ndarray
"""
X = gen_pref_test.X
y_pred = []
for i in range(gen_pref_test.n):
Expand Down
8 changes: 4 additions & 4 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"feat_gen" : "GenHPolyF",
"feat_gen_params" : [3],
"pref_generator" : "macro",
"columns_budget" : 1000,
"iterations" : 10,
"solver" : "LinProg",
"solver_params" : [0]
"columns_budget" : 500,
"iterations" : 100,
"solver" : "FictitiousPlay",
"solver_params" : [1000000]
}
10 changes: 10 additions & 0 deletions config/config_kprl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"algorithm": "KPRL",
"kernel_gen" : "GenHPK",
"kernel_gen_params" : [1,3],
"pref_generator" : "macro",
"columns_budget" : 500,
"iterations" : 100,
"solver" : "FictitiousPlay",
"solver_params" : [1000000]
}
2 changes: 0 additions & 2 deletions run_prl.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ def manage_options():
Xtr = scaler.transform(Xtr)
Xte = scaler.transform(Xte)
elif options["normalize"] == 2:
print("here")
Xtr = normalize(Xtr)
Xte = normalize(Xte)
#
print(Xtr[0,:])

#LOAD CONFIGURATION FILE
with open(options['config_file'], "r") as f:
Expand Down

0 comments on commit a2a799f

Please sign in to comment.