Chapter Session 10 - Machine Learning Classification - June 16, 2018


#1

I have tried multiple times and same error:

Even the folder structure is created but no file in mldata.

/usr/local/anaconda/lib/python3.6/site-packages/sklearn/utils/deprecation.py:85: DeprecationWarning: Function fetch_mldata is deprecated; fetch_mldata was deprecated in version 0.20 and will be removed in version 0.22. Please use fetch_openml.
warnings.warn(msg, category=DeprecationWarning)
/usr/local/anaconda/lib/python3.6/site-packages/sklearn/utils/deprecation.py:85: DeprecationWarning: Function mldata_filename is deprecated; mldata_filename was deprecated in version 0.20 and will be removed in version 0.22. Please use fetch_openml.
warnings.warn(msg, category=DeprecationWarning)

TimeoutError Traceback (most recent call last)
/usr/local/anaconda/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1317 h.request(req.get_method(), req.selector, req.data, headers,
-> 1318 encode_chunked=req.has_header(‘Transfer-encoding’))
1319 except OSError as err: # timeout error

/usr/local/anaconda/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
1238 “”“Send a complete request to the server.”""
-> 1239 self._send_request(method, url, body, headers, encode_chunked)
1240

/usr/local/anaconda/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1284 body = _encode(body, ‘body’)
-> 1285 self.endheaders(body, encode_chunked=encode_chunked)
1286

/usr/local/anaconda/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
1233 raise CannotSendHeader()
-> 1234 self._send_output(message_body, encode_chunked=encode_chunked)
1235

/usr/local/anaconda/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked)
1025 del self._buffer[:]
-> 1026 self.send(msg)
1027

/usr/local/anaconda/lib/python3.6/http/client.py in send(self, data)
963 if self.auto_open:
–> 964 self.connect()
965 else:

/usr/local/anaconda/lib/python3.6/http/client.py in connect(self)
935 self.sock = self._create_connection(
–> 936 (self.host,self.port), self.timeout, self.source_address)
937 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

/usr/local/anaconda/lib/python3.6/socket.py in create_connection(address, timeout, source_address)
723 if err is not None:
–> 724 raise err
725 else:

/usr/local/anaconda/lib/python3.6/socket.py in create_connection(address, timeout, source_address)
712 sock.bind(source_address)
–> 713 sock.connect(sa)
714 # Break explicitly a reference cycle

TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

URLError Traceback (most recent call last)
<ipython-input-2-caec9ae19f90> in <module>
3 # in your home directory.
4 # you can also copy from our dataset using rsync -avz /cxldata/scikit_learn_data .
----> 5 mnist = fetch_mldata(“MNIST original”)
6 mnist

/usr/local/anaconda/lib/python3.6/site-packages/sklearn/utils/deprecation.py in wrapped(*args, **kwargs)
84 def wrapped(*args, **kwargs):
85 warnings.warn(msg, category=DeprecationWarning)
—> 86 return fun(*args, **kwargs)
87
88 wrapped.doc = self._update_doc(wrapped.doc)

/usr/local/anaconda/lib/python3.6/site-packages/sklearn/datasets/mldata.py in fetch_mldata(dataname, target_name, data_name, transpose_data, data_home)
124 urlname = MLDATA_BASE_URL % quote(dataname)
125 try:
–> 126 mldata_url = urlopen(urlname)
127 except HTTPError as e:
128 if e.code == 404:

/usr/local/anaconda/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
221 else:
222 opener = _opener
–> 223 return opener.open(url, data, timeout)
224
225 def install_opener(opener):

/usr/local/anaconda/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
524 req = meth(req)
525
–> 526 response = self._open(req, data)
527
528 # post-process response

/usr/local/anaconda/lib/python3.6/urllib/request.py in _open(self, req, data)
542 protocol = req.type
543 result = self._call_chain(self.handle_open, protocol, protocol +
–> 544 ‘_open’, req)
545 if result:
546 return result

/usr/local/anaconda/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
502 for handler in handlers:
503 func = getattr(handler, meth_name)
–> 504 result = func(*args)
505 if result is not None:
506 return result

/usr/local/anaconda/lib/python3.6/urllib/request.py in http_open(self, req)
1344
1345 def http_open(self, req):
-> 1346 return self.do_open(http.client.HTTPConnection, req)
1347
1348 http_request = AbstractHTTPHandler.do_request_

/usr/local/anaconda/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1318 encode_chunked=req.has_header(‘Transfer-encoding’))
1319 except OSError as err: # timeout error
-> 1320 raise URLError(err)
1321 r = h.getresponse()
1322 except:

URLError: <urlopen error="" [errno="" 110]="" connection="" timed="" out="">

Additionally i also used “rsync -avz /cxldata/scikit_learn_data” it gives below output but no file copied:
sending incremental file list
drwxr-xr-x 4,096 2018/06/16 03:32:10 scikit_learn_data
-rw-r–r-- 15,340,012 2018/06/16 03:32:10 scikit_learn_data/20news-bydate_py3.pkz
-rw-r–r-- 366,877 2018/06/16 03:32:09 scikit_learn_data/cal_housing_py3.pkz
drwxr-xr-x 4,096 2018/06/16 03:32:09 scikit_learn_data/mldata
-rw-r–r-- 55,440,440 2018/06/16 03:32:10 scikit_learn_data/mldata/mnist-original.mat

sent 188 bytes received 433 bytes 1,242.00 bytes/sec
total size is 71,147,329 speedup is 114,568.97