brjapon commited on
Commit
ebd390b
·
1 Parent(s): 43df45d

Added README

Browse files
Files changed (2) hide show
  1. README.md +85 -0
  2. iris_df.joblib → iris_dt.joblib +0 -0
README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: MIT
3
+ language:
4
+ - en
5
+ base_model: null
6
+ pipeline_tag: tabular-classification
7
+ tags:
8
+ - sklearn
9
+ - classification
10
+ - iris
11
+ - tabular
12
+ datasets:
13
+ - brjapon/iris
14
+ metrics:
15
+ - accuracy
16
+ library_name: scikit-learn
17
+ new_version: "v1.0"
18
+ model-index:
19
+ - name: Iris Decision Tree
20
+ results:
21
+ - task:
22
+ type: tabular-classification
23
+ name: Classification
24
+ metrics:
25
+ - type: accuracy
26
+ value: 0.97
27
+ name: Test Accuracy
28
+ ---
29
+
30
+ # Iris Classification Models
31
+
32
+ This repository starts with a **Decision Tree** model trained on the classic **Iris dataset**. The model classifies iris flowers into three species—*setosa*, *versicolor*, or *virginica*—based on four numeric features (sepal length, sepal width, petal length, and petal width).
33
+
34
+ Because of its small size and simplicity, this model is intended primarily for **demonstration and educational** purposes.
35
+
36
+ ## Model Description
37
+ - **Framework**: [Scikit-Learn](https://scikit-learn.org/stable/)
38
+ - **Algorithm**: Decision Tree (`DecisionTreeClassifier` class)
39
+ - **Hyperparameters**:
40
+ - Defaults for Decision Tree in Scikit-Learn
41
+
42
+ ### Intended Uses
43
+ - **Education/Proof-of-Concept**: Demonstrates loading a scikit-learn model from the Hugging Face Hub.
44
+ - **Beginner ML Tutorials**: Introduction to classification tasks, usage of Hugging Face model hosting, and deploying simple demos in Spaces.
45
+
46
+ ### Limitations
47
+ - **Dataset Size**: The Iris dataset is small (150 samples). Performance metrics may not extrapolate to real-world scenarios.
48
+ - **Domain Constraints**: The dataset only covers three iris species and may not generalize to other types of flowers.
49
+ - **Not Production-Ready**: This model is not suited for critical applications (e.g., healthcare, autonomous vehicles).
50
+
51
+ ## How to Use
52
+ To use this model, you can load the `.joblib` file from the Hub in Python code:
53
+
54
+ ```python
55
+ import joblib
56
+ from huggingface_hub import hf_hub_download
57
+
58
+ # Accompanying dataset is hosted in Hugging Face under 'brjapon/iris'
59
+ model_path = hf_hub_download(repo_id="brjapon/iris",
60
+ filename="iris_dt.joblib",
61
+ repo_type="model")
62
+
63
+ model = joblib.load(model_path)
64
+
65
+ # Example prediction (random values below)
66
+ sample_input = [[5.1, 3.5, 1.4, 0.2]]
67
+ prediction = model.predict(sample_input)
68
+ print(prediction) # e.g., [0] which might correspond to 'setosa'
69
+ ```
70
+
71
+ ## Training Procedure
72
+ - **Training Data**: 80% of the 150-sample Iris dataset (120 samples).
73
+ - **Validation Data**: 20% (30 samples).
74
+ - **Steps**:
75
+ 1. Loaded dataset (obtained from HF repository `brjapon/iris`)
76
+ 2. Split into training and test sets with `train_test_split`
77
+ 3. Trained Decision Tree model with default settings
78
+ 4. Evaluated accuracy on the test set
79
+
80
+ ## Performance
81
+ Using a random 80/20 split, the model typically achieves **~97%** accuracy on the test subset. Actual results may vary depending on your specific train/test split random state.
82
+
83
+ ## Limitations & Bias
84
+ - The Iris dataset is not representative of modern, large-scale classification tasks.
85
+ - Results should not be generalized beyond the included species and scenario.
iris_df.joblib → iris_dt.joblib RENAMED
File without changes