mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-01 07:46:22 +02:00
Update to fetch_dataset
This commit is contained in:
parent
5f1eaf1e64
commit
6fe7ac2106
1 changed files with 12 additions and 5 deletions
|
|
@ -17,17 +17,24 @@ def sample_class(f):
|
|||
c = np.where(c, 1, -1)
|
||||
return c
|
||||
|
||||
def fetch_dataset(resource, file_name, messages = True):
|
||||
def fetch_dataset(resource, save_name = None, save_file = True, messages = True):
|
||||
if messages:
|
||||
print "Downloading resource: " , resource, " ... "
|
||||
response = url.urlopen(resource)
|
||||
# TODO: Some error checking...
|
||||
# ...
|
||||
html = response.read()
|
||||
response.close()
|
||||
with open(file_name, "w") as text_file:
|
||||
text_file.write("%s"%html)
|
||||
if messages:
|
||||
print "Done!"
|
||||
if save_file:
|
||||
# TODO: Check if already exists...
|
||||
# ...
|
||||
with open(save_name, "w") as text_file:
|
||||
text_file.write("%s"%html)
|
||||
if messages:
|
||||
print "Done!"
|
||||
return html
|
||||
|
||||
|
||||
|
||||
def della_gatta_TRP63_gene_expression(gene_number=None):
|
||||
mat_data = scipy.io.loadmat(os.path.join(data_path, 'DellaGattadata.mat'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue