<jupyter_start><jupyter_text>Applying Logistic Regression<jupyter_code>from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
from sklearn.model_selection import train_test_split
y = iris_data.target
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.33, random_state=135)
y_test.shape
model.fit(X_train, y_train)
model.predict(X_train[0].reshape(1, -1))
y_train[0]
model.predict(X_test)
y_test
model.predict(X_test) == y_test
y_pred = model.predict(X_test)
model.score(X_test, y_test)
from sklearn.metrics import classification_report
print(classification_report(y_pred=y_pred, y_true=y_test))<jupyter_output>precision    recall  f1-score   support

          0       1.00      1.00      1.00        14
          1       0.94      0.80      0.86        20
          2       0.79      0.94      0.86        16

avg / total       0.91      0.90      0.90        50
{'fraction_non_alphanumeric': 0.08981380065717415, 'fraction_numerical': 0.06352683461117196, 'mean_word_length': 2.8893617021276596, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '235328', 'license': 'MIT', 'n_tokens_mistral': 356, 'n_tokens_neox': 334, 'n_words': 67, 'path': 'Section 3 - Classification.ipynb', 'repo_name': 'archielv/Getting-Started-with-Machine-Learning-in-Python-', 'size': '913'}