Giter Site home page Giter Site logo

notebook's Introduction

SheffieldML Notebook Repository

This repository contains a collection of Jupyter notebooks that can be used for demonstrating our software.

We have split the notebooks into groups.

Background Some background maths for understanding Gaussian processes will appear here.

Computational Biology Notebooks Give some examples of work completed in different projects and implemented in GPy.

GPy Tutorial Notebooks These notebooks give short tutorials on various features of GPy.

Lab Classes Gives a summary of notebooks that have been used in lab classes for teaching using our software. They include notebooks for undergraduate, postgraduate and summer school courses on Gaussian processes and machine learning.

See also the notebooks associated with our open data science software repository.

notebook's People

Contributors

adamian avatar alansaul avatar alessandratosi avatar jameshensman avatar lawrennd avatar lionfish0 avatar mikecroucher avatar mzwiessele avatar partev avatar ric70x7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notebook's Issues

Migrate matplotlib matplot_dep to Python 3.4

Running these demo notebooks with the following configuration:
Python 3.4.3,
IPython 4.0,
OS Windows 8.6.2.9200,
conda 3.17.0,
GPy 0.8.8,
matplotlib 1.4.3,
numpy 1.9.2.

There are some plotting issues with matplotlib and matplot_dep in the migration from MATLAB-like API to matplotlib object-oriented API. In short, the "from pylab import..." is no longer acceptable to Python 3.4. The same for plotting.matplot_dep in GPy-0.8.8.

Also similar problems in building datasets with pods. Is there a standard "conda install" or "pip install" for pods?

Bug in theno day/ variational_MRF

Running with this configuration:
Software Version
Python 3.5.0 64bit [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
IPython 4.0.0
OS Linux 3.19.0 33 generic x86_64 with debian jessie sid
numpy 1.10.1
scipy 0.16.0
matplotlib 1.5.0
theano 0.7.0
GPy 0.8.31
Sat Nov 21 14:42:17 2015 CET

The following error occurs in ln [5], ln [8] to do with 64 bit architecture and ln [9] to do with python 3 for urllib

In [5]:

f(Xval, Yval, b_init, h_init, e_init)

f(Xval, Yval, b_init, h_init, e_init)

TypeError Traceback (most recent call last)
in ()
----> 1 f(Xval, Yval, b_init, h_init, e_init)

/home/denis/anaconda3/lib/python3.5/site-packages/theano/compile/function_module.py in call(self, _args, *_kwargs)
511 try:
512 s.storage[0] = s.type.filter(arg, strict=s.strict,
--> 513 allow_downcast=s.allow_downcast)
514
515 except Exception as e:

/home/denis/anaconda3/lib/python3.5/site-packages/theano/tensor/type.py in filter(self, data, strict, allow_downcast)
129 '"function".'
130 % (self, data.dtype, self.dtype))
--> 131 raise TypeError(err_msg, data)
132 elif (allow_downcast is None and
133 type(data) is float and

TypeError: ('Bad input argument to theano function at index 0(0-based)', 'TensorType(int32, matrix) cannot store a value of dtype int64 without risking loss of precision. If you do not mind this loss, you can: 1) explicitly cast your data to int32, or 2) set "allow_input_downcast=True" when calling "function".', array([[ 1, -1, -1, 1, -1],
[ 1, 1, 1, 1, 1],
[-1, 1, 1, -1, 1],
[ 1, -1, -1, -1, 1],
[ 1, 1, 1, 1, 1],
[-1, 1, -1, -1, 1],
[-1, 1, 1, 1, -1],
[-1, -1, -1, -1, 1],
[ 1, -1, -1, 1, 1],
[-1, -1, -1, -1, 1]]))


In In [8]:

Ef(RSval.flatten(), Yval, b_init, h_init, e_init, N, D)

options = dict()
options['disp']=True

res=sp.optimize.minimize(Ef, RSval.flatten(), (Yval, b_init, h_init, e_init, N, D), jac=True, options=options)#, bounds=optBounds)

optimised_params = res['x']

TypeError Traceback (most recent call last)
in ()
----> 1 Ef(RSval.flatten(), Yval, b_init, h_init, e_init, N, D)
2
3 options = dict()
4 options['disp']=True
5

/home/denis/anaconda3/lib/python3.5/site-packages/theano/compile/function_module.py in call(self, _args, *_kwargs)
511 try:
512 s.storage[0] = s.type.filter(arg, strict=s.strict,
--> 513 allow_downcast=s.allow_downcast)
514
515 except Exception as e:

/home/denis/anaconda3/lib/python3.5/site-packages/theano/tensor/type.py in filter(self, data, strict, allow_downcast)
129 '"function".'
130 % (self, data.dtype, self.dtype))
--> 131 raise TypeError(err_msg, data)
132 elif (allow_downcast is None and
133 type(data) is float and

TypeError: ('Bad input argument to theano function at index 1(0-based)', 'TensorType(int32, matrix) cannot store a value of dtype int64 without risking loss of precision. If you do not mind this loss, you can: 1) explicitly cast your data to int32, or 2) set "allow_input_downcast=True" when calling "function".', array([[ 1, -1, -1, 1, 1],
[-1, -1, -1, -1, 1],
[-1, 1, 1, 1, 1],
[ 1, -1, 1, -1, -1],
[ 1, -1, -1, 1, 1],
[ 1, 1, -1, 1, 1],
[ 1, 1, -1, 1, 1],
[-1, 1, 1, 1, -1],
[ 1, -1, 1, -1, -1],
[-1, 1, -1, 1, -1]]))


In [9]:

import urllib, cStringIO

URL='http://upload.wikimedia.org/wikipedia/en/thumb/9/9e/Flag_of_Japan.svg/1280px-Flag_of_Japan.svg.png'

file = cStringIO.StringIO(urllib.urlopen(URL).read())

img = Image.open(file).convert('L')


import urllib.request, urllib.parse, urllib.error, io
URL='http://upload.wikimedia.org/wikipedia/en/thumb/9/9e/Flag_of_Japan.svg/1280px-Flag_of_Japan.svg.png'
file = io.StringIO(urllib.request.urlopen(URL).read())

img = Image.open(file).convert('L')

TypeError Traceback (most recent call last)
in ()
6 import urllib.request, urllib.parse, urllib.error, io
7 URL='http://upload.wikimedia.org/wikipedia/en/thumb/9/9e/Flag_of_Japan.svg/1280px-Flag_of_Japan.svg.png'
----> 8 file = io.StringIO(urllib.request.urlopen(URL).read())
9 img = Image.open(file).convert('L')

TypeError: initial_value must be str or None, not bytes

How to download the notebook file.

Excuse me,I am a beginner at GPy.And I am feel uncertain about how to download this tutorial.Does anyone can help me about that?Thanks a lot!

Relevant references.

Would it be possible to add some relevant references at the end of notebooks, please? For instance, the notebook on heteroscedastic regression shows how it could be done with GPy, but there are no details or references for the actual maths behind it. Of course there are several papers on this topic. Nonetheless knowing which one is implemented in GPy would help, especially in the case of generating results for research papers using your software.

basic_classification.ipynb plot error

Using

The version of the notebook server is 4.1.0 and is running on:
Python 3.5.1 |Anaconda custom (64-bit)| (default, Dec 7 2015, 11:16:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
Current Kernel Information:
Python 3.5.1 |Anaconda custom (64-bit)| (default, Dec 7 2015, 11:16:01)
IPython 4.1.2 -- An enhanced Interactive Python.

plt.plot(X, f, 'bo') line in basic_classification.ipynb gives the error below

[<matplotlib.lines.Line2D at 0x7f1244069748>]

Error in callback <function install_repl_displayhook..post_execute at 0x7f124f6e2950> (for post_execute):

RuntimeError Traceback (most recent call last)
/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py in post_execute()
145 def post_execute():
146 if matplotlib.is_interactive():
--> 147 draw_all()
148
149 # IPython >= 2

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/_pylab_helpers.py in draw_all(cls, force)
148 for f_mgr in cls.get_all_fig_managers():
149 if force or f_mgr.canvas.figure.stale:
--> 150 f_mgr.canvas.draw_idle()
151
152 atexit.register(Gcf.destroy_all)

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/backend_bases.py in draw_idle(self, _args, *_kwargs)
2024 if not self._is_idle_drawing:
2025 with self._idle_draw_cntx():
-> 2026 self.draw(_args, *_kwargs)
2027
2028 def draw_cursor(self, event):

/home/ave/anaconda3/lib/python3.5/contextlib.py in exit(self, type, value, traceback)
75 value = type()
76 try:
---> 77 self.gen.throw(type, value, traceback)
78 raise RuntimeError("generator didn't stop after throw()")
79 except StopIteration as exc:

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/backend_bases.py in _idle_draw_cntx(self)
1698 def _idle_draw_cntx(self):
1699 self._is_idle_drawing = True
-> 1700 yield
1701 self._is_idle_drawing = False
1702

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/backend_bases.py in draw_idle(self, _args, *_kwargs)
2024 if not self._is_idle_drawing:
2025 with self._idle_draw_cntx():
-> 2026 self.draw(_args, *_kwargs)
2027
2028 def draw_cursor(self, event):

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py in draw(self)
472
473 try:
--> 474 self.figure.draw(self.renderer)
475 finally:
476 RendererAgg.lock.release()

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, _args, *_kwargs)
59 def draw_wrapper(artist, renderer, _args, *_kwargs):
60 before(artist, renderer)
---> 61 draw(artist, renderer, _args, *_kwargs)
62 after(artist, renderer)
63

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/figure.py in draw(self, renderer)
1157 dsu.sort(key=itemgetter(0))
1158 for zorder, a, func, args in dsu:
-> 1159 func(*args)
1160
1161 renderer.close_group('figure')

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, _args, *_kwargs)
59 def draw_wrapper(artist, renderer, _args, *_kwargs):
60 before(artist, renderer)
---> 61 draw(artist, renderer, _args, *_kwargs)
62 after(artist, renderer)
63

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
2322
2323 for zorder, a in dsu:
-> 2324 a.draw(renderer)
2325
2326 renderer.close_group('axes')

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, _args, *_kwargs)
59 def draw_wrapper(artist, renderer, _args, *_kwargs):
60 before(artist, renderer)
---> 61 draw(artist, renderer, _args, *_kwargs)
62 after(artist, renderer)
63

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/axis.py in draw(self, renderer, _args, *_kwargs)
1109
1110 for tick in ticks_to_draw:
-> 1111 tick.draw(renderer)
1112
1113 # scale up the axis label box to also find the neighbors, not

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, _args, *_kwargs)
59 def draw_wrapper(artist, renderer, _args, *_kwargs):
60 before(artist, renderer)
---> 61 draw(artist, renderer, _args, *_kwargs)
62 after(artist, renderer)
63

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/axis.py in draw(self, renderer)
250
251 if self.label1On:
--> 252 self.label1.draw(renderer)
253 if self.label2On:
254 self.label2.draw(renderer)

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, _args, *_kwargs)
59 def draw_wrapper(artist, renderer, _args, *_kwargs):
60 before(artist, renderer)
---> 61 draw(artist, renderer, _args, *_kwargs)
62 after(artist, renderer)
63

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/text.py in draw(self, renderer)
794 textrenderer.draw_text(gc, x, y, clean_line,
795 textobj._fontproperties, angle,
--> 796 ismath=ismath, mtext=mtext)
797
798 gc.restore()

/home/ave/anaconda3/lib/python3.5/contextlib.py in exit(self, type, value, traceback)
75 value = type()
76 try:
---> 77 self.gen.throw(type, value, traceback)
78 raise RuntimeError("generator didn't stop after throw()")
79 except StopIteration as exc:

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/text.py in _wrap_text(textobj)
58 textobj.set_text(old_text)
59 else:
---> 60 yield textobj
61
62

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/text.py in draw(self, renderer)
790 textrenderer.draw_tex(gc, x, y, clean_line,
791 textobj._fontproperties, angle,
--> 792 mtext=mtext)
793 else:
794 textrenderer.draw_text(gc, x, y, clean_line,

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/backends/backend_agg.py in draw_tex(self, gc, x, y, s, prop, angle, ismath, mtext)
251 texmanager = self.get_texmanager()
252
--> 253 Z = texmanager.get_grey(s, size, self.dpi)
254 Z = np.array(Z * 255.0, np.uint8)
255

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/texmanager.py in get_grey(self, tex, fontsize, dpi)
581
582 if alpha is None:
--> 583 pngfile = self.make_png(tex, fontsize, dpi)
584 X = read_png(os.path.join(self.texcache, pngfile))
585

/home/ave/anaconda3/lib/python3.5/site-packages/matplotlib/texmanager.py in make_png(self, tex, fontsize, dpi)
522 'dvipng was not able to process the following '
523 'file:\n%s\nHere is the full report generated by '
--> 524 'dvipng: \n\n' % dvifile + report)
525 else:
526 mpl.verbose.report(report, 'debug')

RuntimeError: dvipng was not able to process the following file:
/home/ave/.cache/matplotlib/tex.cache/c0175f5167fe83d1072385b1c5941a2d.dvi
Here is the full report generated by dvipng:

Prediction with hierarchical model

Hi, again
I'm working in this moment with multiple output GP's and the hierarchical model, the thing is that for the prediction part it's not clear to me which kernel do i have to pass to model.predict(..., kernel) function, for example if i want to make predictions for new inputs over each observed replicates, my intuition and one of the parts of the notebook(https://github.com/SheffieldML/notebook/blob/master/compbio/Hierarchical.ipynb) suggest me that i should pass the hierarchical kernel and not the parent kernel used to predict the underlying trend of all the observations, am i right?
Thanks in advance

Doubt with hierarchical GP's prediction

@lawrennd @mzwiessele @jameshensman I was making a little experiment with hierarchical Gp's in which i generate the replicates similar to the method used in the first part of the hierarchical notebook(https://github.com/SheffieldML/notebook/blob/master/compbio/Hierarchical.ipynb), then what i did was to construct a GP hierarchical model as suggested in the notebook. After the model optimization i wanted to compute the posterior(predict) over the underlying trend given the observed replicates. Although i realized that the mean of the posterior was very similar to the common trend used to generate the data, the full posterior covariance of the underlying trend was not that similar. Thus, maybe am i making some mistake? or maybe i'm misleading myself thinking that is possible to recover the covariance structure of the underlying trend from the replicates. Thanks in advance.
my notebook:
https://github.com/juangil/machine_learning_class/blob/master/GP_tests/mocap_test_1/HGP_Tests.ipynb

Accessing "staffwww.dcs.sheffield.ac.uk/people/J.Hensman" data

There is a common problem on accessing compbio and other datasets: drosophilia, spellman yeasts, Lab3.zip and others. This is in addition to migrating matplotlib and pods to Python 3. Should'nt these datasets be integrated nicely in pods to provide an homogeneous set of testing notebook (gprs, gpss) and "datasets" folder?

The error is:
C:\Users\Denis\Anaconda3\lib\urllib\request.py in http_error_default(self, req, fp, code, msg, hdrs)
587 class HTTPDefaultErrorHandler(BaseHandler):
588 def http_error_default(self, req, fp, code, msg, hdrs):
--> 589 raise HTTPError(req.full_url, code, msg, hdrs, fp)
590
591 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden

how to simultaneously optimize GP and external function

Hi,

I am quite new to GPy, so please forgive my newbyness. I have been checking the tutorials but I could find only little help on what I say below.

I would like to fit a time series with a mean_function that I define. Is it possible to do it with the .optimize() method (or any built-in MC sampler)?

If not, I can define a function that first compute the mean_function and then computes the GP on the corresponding residuals. The problem with this approach is that it takes quite a long time for the GP model to recompute the likelihood at every update of the parameters (I have the feeling that each update is slower then the steps of .optimize(), but I haven't verified it yet).

Do you have any suggestion?

Thanks a lot

Error in callback <function post_execute at 0x7f6c4b198398> (for post_execute)

When I run this code in Jupyter Notebook with the Ubuntu operating system:
fig, ax1 = plt.subplots(nrows=1, figsize=(10,5))
ax1.boxplot(df['est'], labels = ['Boxplot 1'])
ax1.set_title('Diagrama de caja')
ax1.set_xlabel('Representación de la variable 1 del dataframe')
ax1.set_ylabel('Valores')

After having importing and reading the dataset as df:
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
from matplotlib import rcParams
rcParams['figure.figsize'] = (16, 9)

I get the following error: Can anyone help me?
Error in callback <function post_execute at 0x7f6c4b198398> (for post_execute):


ValueError Traceback (most recent call last)
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/pyplot.pyc in post_execute()
147 def post_execute():
148 if matplotlib.is_interactive():
--> 149 draw_all()
150
151 # IPython >= 2

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/_pylab_helpers.pyc in draw_all(cls, force)
134 for f_mgr in cls.get_all_fig_managers():
135 if force or f_mgr.canvas.figure.stale:
--> 136 f_mgr.canvas.draw_idle()
137
138 atexit.register(Gcf.destroy_all)

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in draw_idle(self, *args, **kwargs)
2053 if not self._is_idle_drawing:
2054 with self._idle_draw_cntx():
-> 2055 self.draw(*args, **kwargs)
2056
2057 def draw_cursor(self, event):

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.pyc in draw(self)
435 # if toolbar:
436 # toolbar.set_cursor(cursors.WAIT)
--> 437 self.figure.draw(self.renderer)
438 # A GUI class may be need to update a window using this draw, so
439 # don't forget to call the superclass.

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/figure.pyc in draw(self, renderer)
1491
1492 mimage._draw_list_compositing_images(
-> 1493 renderer, self, artists, self.suppressComposite)
1494
1495 renderer.close_group('figure')

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in draw(self, renderer, inframe)
2633 renderer.stop_rasterizing()
2634
-> 2635 mimage._draw_list_compositing_images(renderer, self, artists)
2636
2637 renderer.close_group('axes')

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/axis.pyc in draw(self, renderer, *args, **kwargs)
1202 self._update_label_position(renderer)
1203
-> 1204 self.label.draw(renderer)
1205
1206 self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in draw(self, renderer)
704
705 with _wrap_text(self) as textobj:
--> 706 bbox, info, descent = textobj._get_layout(renderer)
707 trans = textobj.get_transform()
708

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in _get_layout(self, renderer)
303 baseline = 0
304 for i, line in enumerate(lines):
--> 305 clean_line, ismath = self.is_math_text(line, self.get_usetex())
306 if clean_line:
307 w, h, d = renderer.get_text_width_height_descent(clean_line,

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in is_math_text(s, usetex)
1186 return s, 'TeX'
1187
-> 1188 if cbook.is_math_text(s):
1189 return s, True
1190 else:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/cbook/init.pyc in is_math_text(s)
2033 except UnicodeDecodeError:
2034 raise ValueError(
-> 2035 "matplotlib display text must have all code points < 128 or use "
2036 "Unicode strings")
2037

ValueError: matplotlib display text must have all code points < 128 or use Unicode strings


ValueError Traceback (most recent call last)
/home/miriam/.local/lib/python2.7/site-packages/IPython/core/formatters.pyc in call(self, obj)
332 pass
333 else:
--> 334 return printer(obj)
335 # Finally look for special method names
336 method = get_real_method(obj, self.print_method)

/home/miriam/.local/lib/python2.7/site-packages/IPython/core/pylabtools.pyc in (fig)
245
246 if 'png' in formats:
--> 247 png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
248 if 'retina' in formats or 'png2x' in formats:
249 png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))

/home/miriam/.local/lib/python2.7/site-packages/IPython/core/pylabtools.pyc in print_figure(fig, fmt, bbox_inches, **kwargs)
129
130 bytes_io = BytesIO()
--> 131 fig.canvas.print_figure(bytes_io, **kw)
132 data = bytes_io.getvalue()
133 if fmt == 'svg':

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
2210 orientation=orientation,
2211 dryrun=True,
-> 2212 **kwargs)
2213 renderer = self.figure._cachedRenderer
2214 bbox_inches = self.figure.get_tightbbox(renderer)

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.pyc in print_png(self, filename_or_obj, *args, **kwargs)
515
516 def print_png(self, filename_or_obj, *args, **kwargs):
--> 517 FigureCanvasAgg.draw(self)
518 renderer = self.get_renderer()
519 original_dpi = renderer.dpi

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.pyc in draw(self)
435 # if toolbar:
436 # toolbar.set_cursor(cursors.WAIT)
--> 437 self.figure.draw(self.renderer)
438 # A GUI class may be need to update a window using this draw, so
439 # don't forget to call the superclass.

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/figure.pyc in draw(self, renderer)
1491
1492 mimage._draw_list_compositing_images(
-> 1493 renderer, self, artists, self.suppressComposite)
1494
1495 renderer.close_group('figure')

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/axes/_base.pyc in draw(self, renderer, inframe)
2633 renderer.stop_rasterizing()
2634
-> 2635 mimage._draw_list_compositing_images(renderer, self, artists)
2636
2637 renderer.close_group('axes')

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/axis.pyc in draw(self, renderer, *args, **kwargs)
1202 self._update_label_position(renderer)
1203
-> 1204 self.label.draw(renderer)
1205
1206 self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in draw(self, renderer)
704
705 with _wrap_text(self) as textobj:
--> 706 bbox, info, descent = textobj._get_layout(renderer)
707 trans = textobj.get_transform()
708

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in _get_layout(self, renderer)
303 baseline = 0
304 for i, line in enumerate(lines):
--> 305 clean_line, ismath = self.is_math_text(line, self.get_usetex())
306 if clean_line:
307 w, h, d = renderer.get_text_width_height_descent(clean_line,

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in is_math_text(s, usetex)
1186 return s, 'TeX'
1187
-> 1188 if cbook.is_math_text(s):
1189 return s, True
1190 else:

/home/miriam/.local/lib/python2.7/site-packages/matplotlib/cbook/init.pyc in is_math_text(s)
2033 except UnicodeDecodeError:
2034 raise ValueError(
-> 2035 "matplotlib display text must have all code points < 128 or use "
2036 "Unicode strings")
2037

ValueError: matplotlib display text must have all code points < 128 or use Unicode strings

fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(10,5))

ax2.boxplot(df['est'], labels = ['Boxplot 2'])

How to construct a kernel for coregionalization approaches in multiple outputs.ipynb?

Hi, I am confused in reading the notebook for multiple output in GPy.
In notebook https://github.com/SheffieldML/notebook/blob/ddb2a70491221ceb92d34cc3b7dc8b94f382192c/GPy/multiple%20outputs.ipynb, "**" operator is used to indicate a tensor product between rbf kernel and the coregionalize matrix B. While in the latter Exercise 1, a kernel is constructed as
"kern = ((GPy.kern.RBF(1, variance=1, lengthscale=70)+
GPy.kern.Linear(1, 1, active_dims=[0])+
GPy.kern.White(1)+
GPy.kern.Bias(1, 1))
*GPy.kern.Coregionalize(1, output_dim=2, rank=1, active_dims=1, name='gender')
GPy.kern.Coregionalize(1, output_dim=3, rank=1, active_dims=2, name='event')
)"
with two "
" operator. I don't know if I miss some information or there are several mistakes.
Wish to receive your reply. :)

module 'plotly' has no attribute 'plotly'

Hello, I'm trying to run basic_gp, but when I run

GPy.plotting.show(fig, filename='basic_gp_regression_notebook')

it returns

module 'plotly' has no attribute 'plotly'

also when I type

GPy.plotting.change_plotting_library('plotly')

returns

/usr/local/lib/python3.6/dist-packages/plotly/graph_objs/_deprecations.py:385: DeprecationWarning:

plotly.graph_objs.Line is deprecated.
Please replace it with one of the following more specific types
  - plotly.graph_objs.scatter.Line
  - plotly.graph_objs.layout.shape.Line
  - etc.

What should I do?

Migrating urllib to Python 3.4

In compbio hierarchical.ipynb, the following error is flagged when trying to migrate urllib from python 2.7 to python 3.4. urllib appears to become urllib.request.The solution would apply to several other notebooks.
capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.