Beispiel #1
0
 def testIris_proba(self):
   # If sklearn available.
   if log_loss:
     random.seed(42)
     iris = datasets.load_iris()
     classifier = learn.TensorFlowClassifier(n_classes=3, steps=250)
     classifier.fit(iris.data, iris.target)
     score = log_loss(iris.target, classifier.predict_proba(iris.data))
     self.assertLess(score, 0.8, "Failed with score = {0}".format(score))
Beispiel #2
0
 def testIris_proba(self):
   # If sklearn available.
   if log_loss:
     random.seed(42)
     iris = datasets.load_iris()
     classifier = learn.LinearClassifier(
         feature_columns=learn.infer_real_valued_columns_from_input(iris.data),
         n_classes=3)
     classifier.fit(iris.data, iris.target, max_steps=250)
     score = log_loss(iris.target, classifier.predict_proba(iris.data))
     self.assertLess(score, 0.8, "Failed with score = {0}".format(score))
Beispiel #3
0
 def testIris_proba(self):
   # If sklearn available.
   if log_loss:
     random.seed(42)
     iris = datasets.load_iris()
     classifier = learn.LinearClassifier(
         feature_columns=learn.infer_real_valued_columns_from_input(iris.data),
         n_classes=3)
     classifier.fit(iris.data, iris.target, max_steps=250)
     score = log_loss(iris.target, list(classifier.predict_proba(iris.data)))
     self.assertLess(score, 0.8, "Failed with score = {0}".format(score))