0

This is the code which uses tensorflow library.

import tensorflow.contrib.learn as skflow
from sklearn import datasets, metrics

iris = datasets.load_iris()

print iris

classifier = skflow.TensorFlowLinearClassifier(n_classes=3)

classifier.fit(iris.data, iris.target)
score=metrics.accuracy_score(iris.target,classifier.predict(iris.data))            

print ("Accracy: %f" % score)  

I have created a python virtual environment and installed tensorflow in it. I tried to use conda as well this results in similar error

3
  • What exactly is your question? Commented Nov 20, 2016 at 5:24
  • @DᴀʀᴛʜVᴀᴅᴇʀ how to solve this error? Commented Nov 20, 2016 at 6:21
  • skflow? What documentation are you looking at? Have you referred here? tensorflow.org/versions/r0.11/api_docs/python/… Commented Nov 20, 2016 at 6:36

2 Answers 2

2

They have changed the name to LinearClassifier, therefore this will work

classifier = skflow.LinearClassifier(n_classes=3)
Sign up to request clarification or add additional context in comments.

Comments

-1

try using from tensorflow.contrib.learn import TensorFlowLinearClassifier

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.