<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Train a Machine Learning model using scikit-learn that can solve a binary classification problem.
Dataset - number of samples 1000, number of features 5, target label - binary<|im_end|>
<|im_start|>assistant
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression

X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)

logreg = LogisticRegression(random_state=0).fit(X_train, y_train)<|im_end|>
