Created
July 16, 2016 17:14
-
-
Save anonymous/a8545170cc952aed56bb8abd798b04d7 to your computer and use it in GitHub Desktop.
sample code for skflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import metrics, cross_validation | |
from tensorflow.contrib import learn | |
iris = learn.datasets.load_iris() | |
X_train, X_test, y_train, y_test = cross_validation.train_test_split( | |
iris.data, iris.target, test_size=0.2, random_state=42) | |
classifier = learn.DNNClassifier(hidden_units=[10,20,10], n_classes=3) | |
classifier.fit(x=X_train, y=y_train, steps=200) | |
print(metrics.accuracy_score(classifier.predict(X_test), y_test)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment