Views
No views yet
DecisionTreeClassifier class).joblib file from the Hub in Python code:1import joblib
2from huggingface_hub import hf_hub_download
3
4# Accompanying dataset is hosted in Hugging Face under 'brjapon/iris'
5model_path = hf_hub_download(repo_id="brjapon/iris",
6 filename="iris_dt.joblib",
7 repo_type="model")
8
9model = joblib.load(model_path)
10
11# Example prediction (random values below)
12sample_input = [[5.1, 3.5, 1.4, 0.2]]
13prediction = model.predict(sample_input)
14print(prediction) # e.g., [0] which might correspond to 'setosa'brjapon/iris)train_test_split