Reputation: 3
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
Upvotes: 0
Views: 988
Reputation: 1410
They have changed the name to LinearClassifier
, therefore this will work
classifier = skflow.LinearClassifier(n_classes=3)
Upvotes: 2
Reputation: 51
try using from tensorflow.contrib.learn import TensorFlowLinearClassifier
Upvotes: -1