Views
No views yet
| Property | Value |
|---|---|
| Algorithm | Random Forest |
| n_estimators | 100 |
| Test Accuracy | 0.9000 |
| Train samples | 120 |
| Test samples | 30 |
setosaversicolorvirginica1import pickle, numpy as np
2
3with open("model.pkl", "rb") as f: model = pickle.load(f)
4with open("scaler.pkl", "rb") as f: scaler = pickle.load(f)
5
6# sepal length, sepal width, petal length, petal width (all in cm)
7X = np.array([[5.1, 3.5, 1.4, 0.2]])
8X_scaled = scaler.transform(X)
9prediction = model.predict(X_scaled)
10print(prediction) # e.g. [0] → setosa| Class | Precision | Recall | F1-score |
|---|---|---|---|
| setosa | 1.0000 | 1.0000 | 1.0000 |
| versicolor | 0.8182 | 0.9000 | 0.8571 |
| virginica | 0.8889 | 0.8000 | 0.8421 |