skdata icon indicating copy to clipboard operation
skdata copied to clipboard

Iris example not working (data is not downloaded?)

Open MartinThoma opened this issue 7 years ago • 1 comments

When I execute

# Create a suitable view of the Iris data set.
# (For larger data sets, this can trigger a download the first time)
from skdata.iris.view import KfoldClassification
iris_view = KfoldClassification(5)

# Create a learning algorithm based on scikit-learn's LinearSVC
# that will be driven by commands the `iris_view` object.
from sklearn.svm import LinearSVC
from skdata.base import SklearnClassifier
learning_algo = SklearnClassifier(LinearSVC)

# Drive the learning algorithm from the data set view object.
# (An iterator interface is sometimes also be available,
#  so you don't have to give up control flow completely.)
iris_view.protocol(learning_algo)

# The learning algorithm keeps track of what it did when under
# control of the iris_view object. This base example is useful for
# internal testing and demonstration. Use a custom learning algorithm
# to track and save the statistics you need.
for loss_report in algo.results['loss']:
    print loss_report['task_name'] + \
        (": err = %0.3f" % (loss_report['err_rate']))

I get

/home/moose/.local/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
  "This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
  File "testskdata.py", line 4, in <module>
    iris_view = KfoldClassification(5)
  File "build/bdist.linux-x86_64/egg/skdata/iris/view.py", line 27, in __init__
  File "build/bdist.linux-x86_64/egg/skdata/toy.py", line 20, in __init__
  File "build/bdist.linux-x86_64/egg/skdata/toy.py", line 33, in build_all
  File "build/bdist.linux-x86_64/egg/skdata/iris/dataset.py", line 91, in build_meta
IOError: [Errno 20] Not a directory: '/usr/local/lib/python2.7/dist-packages/skdata-0.0.4-py2.7.egg/skdata/iris/iris.csv'

MartinThoma avatar Jan 30 '17 19:01 MartinThoma