<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Advanced Machine Learning with scikit-learn
me 
Step1:  Grid-Search and Cross-Validation
<img src="grid_search_svm.png">
Model Complexity
<img src="overfitting_underfitting_cartoon.svg" width="70%">
Step2:  Processing Pipelines
<img src="pipeline.svg" width=60%>
Real World Data
<ASSISTANT_TASK:>
Python Code:
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
from sklearn.cross_validation import train_test_split
X, y = make_classification(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
lr = LogisticRegression().fit(X_train, y_train)
print("predictions: %s" % lr.predict(X_test))
print("accuracy: %.2f" % lr.score(X_test, y_test))
Explanation: Advanced Machine Learning with scikit-learn
me : Andreas Mueller
<img src="portrait_amueller.jpeg" width="200px">
API Review
End of explanation
%matplotlib inline
from plot_forest import plot_forest_interactive
plot_forest_interactive()
Explanation: Grid-Search and Cross-Validation
<img src="grid_search_svm.png">
Model Complexity
<img src="overfitting_underfitting_cartoon.svg" width="70%">
End of explanation
X = [{'age': 15.9, 'likes puppies': 'yes', 'location': 'Tokyo'},
     {'age': 21.5, 'likes puppies': 'no',  'location': 'New York'},
     {'age': 31.3, 'likes puppies': 'no',  'location': 'Paris'},
     {'age': 25.1, 'likes puppies': 'yes', 'location': 'New York'},
     {'age': 63.6, 'likes puppies': 'no',  'location': 'Tokyo'},
     {'age': 14.4, 'likes puppies': 'yes', 'location': 'Tokyo'}]
from sklearn.feature_extraction import DictVectorizer
vect = DictVectorizer(sparse=False).fit(X)
print(vect.transform(X))
print("feature names: %s" % vect.get_feature_names())
Explanation: Processing Pipelines
<img src="pipeline.svg" width=60%>
Real World Data
End of explanation
<END_TASK>