<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Title
Step1:  Load Iris Flower Dataset
Step2:  Standardize Features
Step3:  Create Logistic Regression
Step4:  Train Logistic Regression
Step5:  Create Previously Unseen Observation
Step6:  Predict Class Of Observation
Step7:  View Predicted Probabilities
<ASSISTANT_TASK:>
Python Code:
# Load libraries
from sklearn.linear_model import LogisticRegression
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
Explanation: Title: Logistic Regression
Slug: logistic_regression
Summary: How to train a logistic regression in scikit-learn.
Date: 2017-09-21 12:00
Category: Machine Learning
Tags: Logistic Regression
Authors: Chris Albon  
Despite having "regression" in its name, a logistic regression is actually a widely used binary classifier (i.e. the target vector can only take two values). In a logistic regression, a linear model (e.g. $\beta_{0}+\beta_{1}x$) is included in a logistic (also called sigmoid) function, ${\frac {1}{1+e^{-z}}}$, such that:
$$P(y_i=1 \mid X)={\frac {1}{1+e^{-(\beta_{0}+\beta_{1}x)}}}$$
where $P(y_i=1 \mid X)$ is the probability of the $i$th observation's target value, $y_i$, being class 1, $X$ is the training data, $\beta_0$ and $\beta_1$ are the parameters to be learned, and $e$ is Euler's number.
Preliminaries
End of explanation
# Load data with only two classes
iris = datasets.load_iris()
X = iris.data[:100,:]
y = iris.target[:100]
Explanation: Load Iris Flower Dataset
End of explanation
# Standarize features
scaler = StandardScaler()
X_std = scaler.fit_transform(X)
Explanation: Standardize Features
End of explanation
# Create logistic regression object
clf = LogisticRegression(random_state=0)
Explanation: Create Logistic Regression
End of explanation
# Train model
model = clf.fit(X_std, y)
Explanation: Train Logistic Regression
End of explanation
# Create new observation
new_observation = [[.5, .5, .5, .5]]
Explanation: Create Previously Unseen Observation
End of explanation
# Predict class
model.predict(new_observation)
Explanation: Predict Class Of Observation
End of explanation
# View predicted probabilities
model.predict_proba(new_observation)
Explanation: View Predicted Probabilities
End of explanation
<END_TASK>