Last active
July 9, 2016 19:12
-
-
Save dsal1951/297d153d0a32447d927de34a75268298 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Create dataset | |
x,y = datasets.make_classification(n_samples=10000, n_features=20, | |
n_informative=15,n_redundant=5, | |
n_classes=2, weights=[0.95,0.05], | |
random_state=1000) | |
#Split into Training and Test sets | |
x_train, x_test, y_train, y_test = cross_validation.train_test_split(x,y, | |
test_size=0.3,random_state=1000) | |
#Train a Decision Tree to Predict y | |
clf = tree.DecisionTreeClassifier(min_samples_leaf=10) | |
clf.fit(x_train,y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment