<jupyter_start><jupyter_text>Reviewing a simple sklearn model<jupyter_code># flatten the images
from sklearn import datasets, svm, metrics
from sklearn.model_selection import train_test_split
import mlflow

n_samples = len(digits.images)
data = digits.images.reshape((n_samples, -1))

# Create a classifier: a support vector classifier
clf = svm.SVC(gamma=0.003)

# Split data into 50% train and 50% test subsets
X_train, X_test, y_train, y_test = train_test_split(
    data, digits.target, test_size=0.5, shuffle=False)

# enable autologging
mlflow.sklearn.autolog()

# Learn the digits on the train subset
with mlflow.start_run():
    clf.fit(X_train, y_train)


artifact_path: model
flavors:
  python_function:
    env: conda.yaml
    loader_module: mlflow.sklearn
    model_path: model.pkl
    python_version: 3.7.6
  sklearn:
    pickled_model: model.pkl
    serialization_format: cloudpickle
    sklearn_version: 0.22.2.post1
run_id: 57d4216eeea1499c8607b1d3f6265775
signature:
  inputs: '[{"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"},
    {"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"},
    {"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"},
    {"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"},
    {"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"},
    {"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"},
    {"type": "double"}, {"type": "double"}, {"type": "double"}, {"type": "double"}]'
  outputs: '[{"type": "long"}]'
utc_time_created: '2021-03-11 19:28:54.202276'<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19834221432800472, 'fraction_numerical': 0.036708111308466546, 'mean_word_length': 5.525096525096525, 'pattern_counts': {'":': 29, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '155298', 'license': 'MIT', 'n_tokens_mistral': 635, 'n_tokens_neox': 590, 'n_words': 151, 'path': 'Chapter05/gradflow/notebooks/models_under_the_hood_mlflow.ipynb', 'repo_name': 'waltatgit/Machine-Learning-Engineering-with-MLflow', 'size': '1689'}