Giter VIP home page Giter VIP logo

Comments (4)

terrytangyuan avatar terrytangyuan commented on September 28, 2024

Could you point out which example you are trying? The versions look correct to me and I just tried one of the examples involving pandas. Also, what's the name of the python script you are executing? Sometimes bad file name or existing pd variable in the environment could cause this problem. Try using IPython to run it from scratch.

from skflow.

haarburger avatar haarburger commented on September 28, 2024

I'm running

import skflow
from sklearn import datasets, metrics

iris = datasets.load_iris()
classifier = skflow.TensorFlowLinearClassifier(n_classes=3)
classifier.fit(iris.data, iris.target)
score = metrics.accuracy_score(classifier.predict(iris.data), iris.target)
print("Accuracy: %f" % score)

with IPython and I get

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/chris/Workspace/Playground/test.py in <module>()
      4 iris = datasets.load_iris()
      5 classifier = skflow.TensorFlowLinearClassifier(n_classes=3)
----> 6 classifier.fit(iris.data, iris.target)
      7 score = metrics.accuracy_score(classifier.predict(iris.data), iris.target)
      8 print("Accuracy: %f" % score)

/home/chris/anaconda3/lib/python3.4/site-packages/skflow/estimators/base.py in fit(self, X, y, logdir)
    182         self._data_feeder = setup_train_data_feeder(X, y,
    183                                                     self.n_classes,
--> 184                                                     self.batch_size)
    185         if not self.continue_training or not self._initialized:
    186             # Sets up model and trainer.

/home/chris/anaconda3/lib/python3.4/site-packages/skflow/io/data_feeder.py in setup_train_data_feeder(X, y, n_classes, batch_size)
     71         DataFeeder object that returns training data.
     72     """
---> 73     X, y = _data_type_filter(X, y)
     74     if HAS_DASK:
     75         import dask.dataframe as dd

/home/chris/anaconda3/lib/python3.4/site-packages/skflow/io/data_feeder.py in _data_type_filter(X, y)
     49         y = extract_dask_labels(y)
     50     if HAS_PANDAS:
---> 51         X = extract_pandas_data(X)
     52         y = extract_pandas_labels(y)
     53     return X, y

/home/chris/anaconda3/lib/python3.4/site-packages/skflow/io/pandas_io.py in extract_pandas_data(data)
     27 def extract_pandas_data(data):
     28     """Extract data from pandas.DataFrame for predictors"""
---> 29     if not isinstance(data, pd.DataFrame):
     30         return data
     31 

AttributeError: 'module' object has no attribute 'DataFrame'

I don't think there's a anything wrong with the code. Maybe the issue is related to pands? If I run multioutput_regression.py I get the same error in pandas_io.py as above.

from skflow.

terrytangyuan avatar terrytangyuan commented on September 28, 2024

Thanks. Could you try reinstall pandas then? The pandas version is the same as the one I am using though. Googled around it seems like this happens a lot. Try some solutions from Google results.

from skflow.

haarburger avatar haarburger commented on September 28, 2024

Thanks, after I reinstalled pandas it worked.

from skflow.

Related Issues (20)

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.