Code Monkey home page Code Monkey logo

mglearn's Introduction

Helper functions for the book "Introduction to Machine Learning with Python"

This is the mglearn package used in the book, which you can also find in the accompanying repository

You don't need this repo, all the code is there:

https://github.com/amueller/introduction_to_ml_with_python

This repository is a stand-alone package in case you really feel like you want to install mglearn into your Python environment, for some reason or another. You can install it by running

pip install mglearn

in your terminal, or by running

%pip install mglearn

in Jupyter Notebook.

In particular, installing this package is a very easy way to add it to your Python search path. Or you can just check out the notebooks from the repository above, and add the path to the mglearn subfolder to your PYTHONPATH environment variable (or set it in your IDE).

mglearn's People

Contributors

amueller avatar idahogray avatar keith-gray-powereng 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

mglearn's Issues

import mglearn in MacOS for Python 3 (3.7) error

Hello,

My apologies if this issue is already solved but I tried looking around and I trying to figures out how to install mglearn in Python 3 rather than Python 2 on my MacOS.

import mglearn
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mglearn/init.py", line 1, in
from . import plots
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mglearn/plots.py", line 14, in
from .plot_pca import plot_pca_illustration, plot_pca_whitening, plot_pca_faces
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mglearn/plot_pca.py", line 7, in
memory = Memory(cachedir="cache")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sklearn/externals/joblib/memory.py", line 897, in init
**backend_options))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sklearn/externals/joblib/memory.py", line 125, in _store_backend_factory
backend_options=backend_options)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sklearn/externals/joblib/_store_backends.py", line 401, in configure
mkdirp(self.location)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sklearn/externals/joblib/disk.py", line 60, in mkdirp
os.makedirs(d)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 211, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 221, in makedirs
mkdir(name, mode)
PermissionError: [Errno 1] Operation not permitted: 'cache'

I got an PermissionError according to my error message.

UserMBP:bin user$ pip3 install mglearn
Requirement already satisfied: mglearn in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.1.7)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (1.16.2)
Requirement already satisfied: matplotlib in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (3.0.3)
Requirement already satisfied: scikit-learn in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (0.20.3)
Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (0.24.2)
Requirement already satisfied: pillow in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (6.0.0)
Requirement already satisfied: cycler in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (0.10.0)
Requirement already satisfied: imageio in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from mglearn) (2.5.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->mglearn) (1.0.1)
Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->mglearn) (2.8.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from matplotlib->mglearn) (2.4.0)
Requirement already satisfied: scipy>=0.13.3 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from scikit-learn->mglearn) (1.2.1)
Requirement already satisfied: pytz>=2011k in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas->mglearn) (2019.1)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from cycler->mglearn) (1.12.0)
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib->mglearn) (40.8.0)

As you can see mglearn is already installed.

Thanks,

staronline1and2

Unable to install mglearn

I am trying to install mglearn in Spyder. The pip seems to find mglearn, but it cannot be imported. The pip I am using is as follows: C:\Users\User\Anaconda3\Scripts\pip.exe install mglearn

This is an example of the error messages I get when I try to use it:

import mglearn
X,y=mglearn.datasets.load_extended_boston()
print("X.shape: {}".format(X.shape))
ImportError: DLL load failed: The specified module could not be found.
bootstrap()
File "C:\Users\User\Anaconda3\lib\site-packages\scipy\ndimage_nd_image.py", line 6, in bootstrap
imp.load_dynamic(name,file)
File "C:\Users\User\Anaconda3\lib\imp.py", line 342, in load_dynamic
return load(spec)
from . import plots
File "C:\Users\User\Anaconda3\lib\site-packages\mglearn\plots.py", line 2, in
from .plot_interactive_tree import plot_tree_progressive, plot_tree_partition
File "C:\Users\User\Anaconda3\lib\site-packages\mglearn\plot_interactive_tree.py", line 9, in
from scipy import ndimage
File "C:\Users\User\Anaconda3\lib\site-packages\scipy\ndimage_init
.py", line 161, in
from .filters import *
File "C:\Users\User\Anaconda3\lib\site-packages\scipy\ndimage\filters.py", line 36, in
from . import nd_image
File "C:\Users\User\Anaconda3\lib\site-packages\scipy\ndimage_nd_image.py", line 7, in
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\User\Anaconda3\lib\site-packages\mglearn_init
.py", line 1, in

ImportError in `scipy.misc import image`

Problem:

For me (after pip installing mglearn and pillow) when running import mglearn, the following import error was raised:

ImportError Traceback (most recent call last)
in ()
4 get_ipython().magic('matplotlib inline')
5 import pandas as pd
----> 6 import mglearn
7
8 from sklearn.model_selection import train_test_split

/Users/me/programs/py3/lib/python3.5/site-packages/mglearn/init.py in ()
----> 1 from . import plots
2 from . import tools
3 from .plots import cm3, cm2
4 from .tools import discrete_scatter
5 from .plot_helpers import ReBl

/Users/me/programs/py3/lib/python3.5/site-packages/mglearn/plots.py in ()
1 from .plot_linear_svc_regularization import plot_linear_svc_regularization
----> 2 from .plot_interactive_tree import plot_tree_progressive, plot_tree_partition
3 from .plot_animal_tree import plot_animal_tree
4 from .plot_rbf_svm_parameters import plot_svm
5 from .plot_knn_regression import plot_knn_regression

/Users/me/programs/py3/lib/python3.5/site-packages/mglearn/plot_interactive_tree.py in ()
6 from sklearn.externals.six import StringIO # doctest: +SKIP
7 from sklearn.tree import export_graphviz
----> 8 from scipy.misc import imread
9 from scipy import ndimage
10 from sklearn.datasets import make_moons

ImportError: cannot import name 'imread'

Fix:

I changed the following import line in the mglearn/plot_animal_tree.py and mglearn/plot_interactive_tree.py files from:

from scipy.misc import imread

to

from scipy.misc.pilutil import imread.

This fixed the issue.

Context

MacOS Jupyter notebook from a miniconda environment.

python==3.6.0
mglearn==0.1.3
pillow==4.0.0
scipy==0.18.1

Mglearn issue after the latest ubuntu update

For 2 months I have been using mglearn but since I updated to latest ubuntu release, whenever i import it shows 'No module name sklearn.externals.joblib' in the jupyter notebook. It gets fixed after reinstalling anaconda. But after shutting down the system and restarting, same error occurs
1591791831008804846605

ModuleNotFoundError: No module named 'mglearn'

I have already installed the mglearn package through the comand pip install mglearn in Anaconda Prompt. The installation was successful because I see the folders mglearn and mglearn-0.1.7.dist-info inside site-packages, and when I run the comand pip install mglearn in the Anaconda Prompt, I receive the following message:
Requirement already satisfied: mglearn in c:\users\cesco\anaconda3\lib\site-packages (0.1.7)
.... (some other stuff)
However, I receive the following error from Spyder:
import mglearn
ModuleNotFoundError: No module named 'mglearn'

I have already tried to restart the computer and the program.
I am using Spyder, just in case this might be important.
Any hint on where the problem might be?
Thank you for your help

Version Issue

Current version is not compatible with sklearn 1.2. In version 1.2 the load_boston dataset has been removed.

issue in accessing mglearn package

ImportError:
load_boston has been removed from scikit-learn since version 1.2.

The Boston housing prices dataset has an ethical problem: as
investigated in [1], the authors of this dataset engineered a
non-invertible variable "B" assuming that racial self-segregation had a
positive impact on house prices [2]. Furthermore the goal of the
research that led to the creation of this dataset was to study the
impact of air quality but it did not give adequate demonstration of the
validity of this assumption.

The scikit-learn maintainers therefore strongly discourage the use of
this dataset unless the purpose of the code is to study and educate
about ethical issues in data science and machine learning.

In this special case, you can fetch the dataset from the original
source::

import pandas as pd
import numpy as np

data_url = "http://lib.stat.cmu.edu/datasets/boston"
raw_df = pd.read_csv(data_url, sep="\s+", skiprows=22, header=None)
data = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])
target = raw_df.values[1::2, 2]

Alternative datasets include the California housing dataset and the
Ames housing dataset. You can load the datasets as follows::

from sklearn.datasets import fetch_california_housing
housing = fetch_california_housing()

for the California housing dataset and::

from sklearn.datasets import fetch_openml
housing = fetch_openml(name="house_prices", as_frame=True)

for the Ames housing dataset.

[1] M Carlisle.
"Racist data destruction?"
https://medium.com/@docintangible/racist-data-destruction-113e3eff54a8

[2] Harrison Jr, David, and Daniel L. Rubinfeld.
"Hedonic housing prices and the demand for clean air."
Journal of environmental economics and management 5.1 (1978): 81-102.
https://www.researchgate.net/publication/4974606_Hedonic_housing_prices_and_the_demand_for_clean_air

I believe I have reinstalled scipy, but I am still unable to open mglearn.

I believe I have reinstalled scipy, but I am still unable to open mglearn. This is what happens:

import scipy

import mglearn
Traceback (most recent call last):

File "", line 1, in
import mglearn

File "C:\Users\User\Anaconda3\lib\site-packages\mglearn_init_.py", line 1, in
from . import plots

File "C:\Users\User\Anaconda3\lib\site-packages\mglearn\plots.py", line 14, in
from .plot_pca import plot_pca_illustration, plot_pca_whitening, plot_pca_faces

File "C:\Users\User\Anaconda3\lib\site-packages\mglearn\plot_pca.py", line 1, in
from sklearn.decomposition import PCA

File "C:\Users\User\Anaconda3\lib\site-packages\sklearn\decomposition_init_.py", line 19, in
from .online_lda import LatentDirichletAllocation

File "C:\Users\User\Anaconda3\lib\site-packages\sklearn\decomposition\online_lda.py", line 22, in
from ..utils.fixes import logsumexp

ImportError: cannot import name 'logsumexp'

from scipy import ndimage

import mglearn
Traceback (most recent call last):

File "", line 1, in
import mglearn

File "C:\Users\User\Anaconda3\lib\site-packages\mglearn_init_.py", line 1, in
from . import plots

File "C:\Users\User\Anaconda3\lib\site-packages\mglearn\plots.py", line 14, in
from .plot_pca import plot_pca_illustration, plot_pca_whitening, plot_pca_faces

File "C:\Users\User\Anaconda3\lib\site-packages\mglearn\plot_pca.py", line 1, in
from sklearn.decomposition import PCA

File "C:\Users\User\Anaconda3\lib\site-packages\sklearn\decomposition_init_.py", line 19, in
from .online_lda import LatentDirichletAllocation

File "C:\Users\User\Anaconda3\lib\site-packages\sklearn\decomposition\online_lda.py", line 22, in
from ..utils.fixes import logsumexp

ImportError: cannot import name 'logsumexp'

mglearn MacOsx : AttributeError: module 'enum' has no attribute 'IntFlag'

Hi
The installation of mglearn work fine but when I try to import the module I have this error "AttributeError: module 'enum' has no attribute 'IntFlag'"

I tried to installl with pip3 and -user option without any improvement.
I tried to uninstall and reinstall, then to remove enum directory but importation failed.
Any Idea ?

note : Python3.7 Mac Osx Mojave

error with plot_animal_tree

import mglearn
mglearn.plots.plot_animal_tree()

error log

/opt/anaconda3/lib/python3.7/site-packages/sklearn/externals/six.py:31: DeprecationWarning: The module is deprecated in version 0.21 and will be removed in version 0.23 since we've dropped support for Python 2.7. Please rely on the official version of six (https://pypi.org/project/six/).
  "(https://pypi.org/project/six/).", DeprecationWarning)
/opt/anaconda3/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
  warnings.warn(msg, category=DeprecationWarning)
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/opt/anaconda3/lib/python3.7/site-packages/graphviz/backend.py in run(cmd, input, capture_output, check, quiet, **kwargs)
    158     try:
--> 159         proc = subprocess.Popen(cmd, startupinfo=get_startupinfo(), **kwargs)
    160     except OSError as e:

/opt/anaconda3/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    774                                 errread, errwrite,
--> 775                                 restore_signals, start_new_session)
    776         except:

/opt/anaconda3/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1521                             err_msg += ': ' + repr(err_filename)
-> 1522                     raise child_exception_type(errno_num, err_msg, err_filename)
   1523                 raise child_exception_type(err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

During handling of the above exception, another exception occurred:

ExecutableNotFound                        Traceback (most recent call last)
<ipython-input-2-53d3a20defda> in <module>
      1 import mglearn
----> 2 mglearn.plots.plot_animal_tree()

/opt/anaconda3/lib/python3.7/site-packages/mglearn/plot_animal_tree.py in plot_animal_tree(ax)
     23     mygraph.edge("2", "5", label="True")
     24     mygraph.edge("2", "6", label="False")
---> 25     mygraph.render("tmp")
     26     ax.imshow(imread("tmp.png"))
     27     ax.set_axis_off()

/opt/anaconda3/lib/python3.7/site-packages/graphviz/files.py in render(self, filename, directory, view, cleanup, format, renderer, formatter, quiet, quiet_view)
    207         rendered = backend.render(self._engine, format, filepath,
    208                                   renderer=renderer, formatter=formatter,
--> 209                                   quiet=quiet)
    210 
    211         if cleanup:

/opt/anaconda3/lib/python3.7/site-packages/graphviz/backend.py in render(engine, format, filepath, renderer, formatter, quiet)
    204     else:
    205         cwd = None
--> 206     run(cmd, capture_output=True, cwd=cwd, check=True, quiet=quiet)
    207     return rendered
    208 

/opt/anaconda3/lib/python3.7/site-packages/graphviz/backend.py in run(cmd, input, capture_output, check, quiet, **kwargs)
    160     except OSError as e:
    161         if e.errno == errno.ENOENT:
--> 162             raise ExecutableNotFound(cmd)
    163         else:
    164             raise

ExecutableNotFound: failed to execute ['dot', '-Tpng', '-O', 'tmp'], make sure the Graphviz executables are on your systems' PATH

imread error while importing mglearn

I'm getting "ImportError: cannot import name 'imread'" when I try to import mglearn
As per a previous thread, I have tried this:
from scipy.misc.pilutil import imread
But the error is still there. Please help.

imread error for MG learn

I did some research and I believe the issue stems from 'imread' no longer being part of SCIPY.

ImportError Traceback (most recent call last)
in ()
2
3
----> 4 import mglearn

~\AppData\Local\Continuum\anaconda3\lib\site-packages\mglearn_init_.py in ()
----> 1 from . import plots
2 from . import tools
3 from .plots import cm3, cm2
4 from .tools import discrete_scatter
5 from .plot_helpers import ReBl

~\AppData\Local\Continuum\anaconda3\lib\site-packages\mglearn\plots.py in ()
1 from .plot_linear_svc_regularization import plot_linear_svc_regularization
----> 2 from .plot_interactive_tree import plot_tree_progressive, plot_tree_partition
3 from .plot_animal_tree import plot_animal_tree
4 from .plot_rbf_svm_parameters import plot_svm
5 from .plot_knn_regression import plot_knn_regression

~\AppData\Local\Continuum\anaconda3\lib\site-packages\mglearn\plot_interactive_tree.py in ()
6 from sklearn.externals.six import StringIO # doctest: +SKIP
7 from sklearn.tree import export_graphviz
----> 8 from scipy.misc import imread
9 from scipy import ndimage
10 from sklearn.datasets import make_moons

ImportError: cannot import name 'imread'

Error importing mglearn because of deprecated scikitlearn package "load_boston"

Hi,

I am trying to import mg lean and getting the following error, most likely due to a deprecated scikit-learn package.

File ~/miniconda3/envs/mlEnv/lib/python3.9/site-packages/sklearn/datasets/init.py:156, in getattr(name)
105 if name == "load_boston":
106 msg = textwrap.dedent(
107 """
108 load_boston has been removed from scikit-learn since version 1.2.
(...)
154 """
155 )
--> 156 raise ImportError(msg)
157 try:
158 return globals()[name]

ImportError:
load_boston has been removed from scikit-learn since version 1.2.

The Boston housing prices dataset has an ethical problem: as
investigated in [1], the authors of this dataset engineered a
non-invertible variable "B" assuming that racial self-segregation had a
positive impact on house prices [2]. Furthermore the goal of the
research that led to the creation of this dataset was to study the
impact of air quality but it did not give adequate demonstration of the
validity of this assumption.

Could you please suggest a workaround for this?

Thank you!

mglearn.plots.plot_cross_val_selection() will throw ValueError

When I run the method
mglearn.plots.plot_cross_val_selection()

I got a error, I installed a pandas v2.0.3

error message:


ValueError Traceback (most recent call last)
in
----> 1 mglearn.plots.plot_cross_val_selection()

~\anaconda3\lib\site-packages\mglearn\plot_grid_search.py in plot_cross_val_selection()
26 for i, (_, row) in enumerate(results.iterrows()):
27 scores = row[['split%d_test_score' % i for i in range(5)]]
---> 28 marker_cv, = plt.plot([i] * 5, scores, '^', c='gray', markersize=5,
29 alpha=.5)
30 marker_mean, = plt.plot(i, row.mean_test_score, 'v', c='none', alpha=1,

~\anaconda3\lib\site-packages\pandas\core\indexers\utils.py in disallow_ndim_indexing(result)
341 """
342 if np.ndim(result) > 1:
--> 343 raise ValueError(
344 "Multi-dimensional indexing (e.g. obj[:, None]) is no longer "
345 "supported. Convert to a numpy array before indexing instead."

ValueError: Multi-dimensional indexing (e.g. obj[:, None]) is no longer supported. Convert to a numpy array before indexing instead.

np.bool is deprecated

np.bool should be bool in this line, according to an error it throws calling this code:

    # generate dataset
    X, y = mglearn.datasets.make_forge()
    # plot dataset
    mglearn.discrete_scatter(X[:, 0], X[:, 1], y)
    plt.legend(["Class 0", "Class 1"], loc=4)
    plt.xlabel("First feature")
    plt.ylabel("Second feature")
    print("X.shape: {}".format(X.shape))
    plt.show()

Readme File!!!

@amueller First of all I would like to thank you for open-sourcing all these files under mglearn. ๐Ÿ‘
Can you add Readme file and other supporting documents (with explanation) for the files under mglearn repo? It would be really great!!!!๐Ÿ˜๐Ÿ˜๐Ÿ˜

error about mglearn instalation

import mglearn
C:\Users\Jade kamyana\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\externals\six.py:31: FutureWarning: The module is deprecated in version 0.21 and will be removed in version 0.23 since we've dropped support for Python 2.7. Please rely on the official version of six (https://pypi.org/project/six/).
"(https://pypi.org/project/six/).", FutureWarning)
C:\Users\Jade kamyana\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\externals\joblib_init_.py:15: FutureWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
warnings.warn(msg, category=FutureWarning)

display(graphviz.Source('dot_graph')) issues

I faced errors with running follows example in the book:


import graphviz
from IPython.display import display
with open("tree.dot") as f:
dot_graph = f.read()
display(graphviz.Source('dot_graph'))


FileNotFoundError Traceback (most recent call last)
e:\Users\users\AppData\Local\Continuum\anaconda3\lib\site-packages\graphviz\backend.py in pipe(engine, format, data, quiet)
158 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
--> 159 **POPEN_KWARGS)
160 except OSError as e:

e:\Users\users\AppData\Local\Continuum\anaconda3\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
708 errread, errwrite,
--> 709 restore_signals, start_new_session)
710 except:

e:\Users\users\AppData\Local\Continuum\anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
996 os.fspath(cwd) if cwd is not None else None,
--> 997 startupinfo)
998 finally:

FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

ExecutableNotFound Traceback (most recent call last)
e:\Users\users\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\formatters.py in call(self, obj)
343 method = get_real_method(obj, self.print_method)
344 if method is not None:
--> 345 return method()
346 return None
347 else:

e:\Users\users\AppData\Local\Continuum\anaconda3\lib\site-packages\graphviz\files.py in repr_svg(self)
104
105 def repr_svg(self):
--> 106 return self.pipe(format='svg').decode(self._encoding)
107
108 def pipe(self, format=None):

e:\Users\users\AppData\Local\Continuum\anaconda3\lib\site-packages\graphviz\files.py in pipe(self, format)
123 data = text_type(self.source).encode(self._encoding)
124
--> 125 outs = backend.pipe(self._engine, format, data)
126
127 return outs

e:\Users\users\AppData\Local\Continuum\anaconda3\lib\site-packages\graphviz\backend.py in pipe(engine, format, data, quiet)
160 except OSError as e:
161 if e.errno == errno.ENOENT:
--> 162 raise ExecutableNotFound(args)
163 else: # pragma: no cover
164 raise

ExecutableNotFound: failed to execute ['dot', '-Tsvg'], make sure the Graphviz executables are on your systems' PATH

<graphviz.files.Source at 0x1d8a7f6d208>


** my versions:
Python version: 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
pandas version: 0.23.0
matplotlib version: 2.2.2
NumPy version: 1.13.3
SciPy version: 1.1.0
IPython version: 6.4.0
scikit-learn version: 0.19.1
graphviz version: 0.8.4

couldn't able to install mglearn in anaconda nor using pip

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • mglearn

Current channels:

pip install mglearn
Collecting mglearn
Exception:
Traceback (most recent call last):
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\req\req_set.py", line 554, in _prepare_file
require_hashes
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\Users\gvvam\Anaconda3\lib\site-packages\pip\index.py", line 731, in init
namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'

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.