Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, path, public_id, secret):
"""
Creates a new SubmissionTarget.
:param: path (str):
local path to the predictions csv file
:param: public_id (str):
public_id as reported by the numer.ai website when creating API
credentials
:param: secret (str):
secret as reported by the numer.ai website when creating API
credentials
"""
self.path = path
self.fn = os.path.split(path)[1]
self.apc = NumerAPI(public_id, secret)
def output(self):
"""
Saves outputs of this task--which is a csv file of the predictions made for the
given data.
"""
self.apc = NumerAPI()
fn ='predictions_{0}_LogisticRegression.csv'.format(self.apc.get_current_round())
return luigi.LocalTarget(os.path.join(self.output_path, fn))
:returns:
A ``dict`` with the following keys:
* ``zipfile``: original file as downloaded
(``numerai_dataset_xxx.zip``)
* ``training_data.csv``: the training data
(``numerai_training_data.csv``)
* ``tournament_data.csv``: the tournament data
(``numerai_tournament_data.csv``)
* ``example_predictions.csv``: example predictions
(``example_predictions.csv``)
Note that ``example_model.py`` and ``example_model.r`` are not referenced,
as these are to no use for us.
"""
self.apc = NumerAPI()
current_round = self.apc.get_current_round()
dataset_name = "numerai_dataset_{0}.zip".format(current_round)
dataset_dir = "numerai_dataset_{0}".format(current_round)
assert self.apc.download_current_dataset(dest_path=self.output_path,
dest_filename=dataset_name,
unzip=True)
# see numerapi download_current_dataset
dataset_path = os.path.join(self.output_path, dataset_dir)
test_data_path = os.path.join(dataset_path, 'numerai_training_data.csv')
tournament_data_path = os.path.join(dataset_path,
'numerai_tournament_data.csv')
example_data_path = os.path.join(dataset_path,