text: 
  from sklearn.feature_selection import RFE
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import StandardScaler
  
  X_train, X_test, y_train, y_test = train_test_split(X,y, test_size=0.3)
  
  # Fit the scaler on the training features and transform these in one go
  X_train_std = scaler.fit_transform(X_train)
  
  # Fit the logistic regression model on the scaled training data
  lr.fit(X_train_std, y_train)
  
  # Scale the test features
  X_test_std = scaler.transform(X_test)
  
  # Predict diabetes presence on the scaled test set
  y_pred = lr.predict(X_test_std)
  
  # Prints accuracy metrics and feature coefficients
  print("{0:.1%} accuracy on test set.".format(accuracy_score(y_test, y_pred)))
  print(dict(zip(X.columns, abs(lr.coef_[0]).round(2))))
  
  # Remove the feature with the lowest model coefficient
  X = diabetes_df[['pregnant', 'glucose', 'triceps', 'insulin', 'bmi', 'family', 'age']]
  
  # Performs a 25-75% train test split
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=0)
  
  # Scales features and fits the logistic regression model
  lr.fit(scaler.fit_transform(X_train), y_train)
  
  # Calculates the accuracy on the test set and prints coefficients
  acc = accuracy_score(y_test, lr.predict(scaler.transform(X_test)))
  print("{0:.1%} accuracy on test set.".format(acc))
  print(dict(zip(X.columns, abs(lr.coef_[0]).round(2))))
  