Views
No views yet
WeightedEnsemble_L2 (ensemble of NeuralNetTorch, XGBoost, LightGBM, FastAI nets)Airline)| Class | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| Air Canada | 1.00 | 1.00 | 1.00 | 1 |
| Allegiant | 1.00 | 1.00 | 1.00 | 2 |
| American | 1.00 | 1.00 | 1.00 | 6 |
| Breeze | 1.00 | 1.00 | 1.00 | 1 |
| Frontier | 1.00 | 1.00 | 1.00 | 7 |
| Southwest | 1.00 | 1.00 | 1.00 | 3 |
| Spirit | 1.00 | 1.00 | 1.00 | 9 |
| United | 1.00 | 1.00 | 1.00 | 1 |
1pip install autogluon==1.4.0 huggingface_hub cloudpickle
2
3import cloudpickle
4from huggingface_hub import hf_hub_download
5
6pkl_path = hf_hub_download(
7 repo_id="cassieli226/hw1-airline-automl",
8 filename="autogluon_predictor.pkl",
9 repo_type="model"
10)
11
12with open(pkl_path, "rb") as f:
13 predictor = cloudpickle.load(f)
14
15import pandas as pd
16X_test = pd.DataFrame({
17 "Stops": [1],
18 "Days from Departure": [30],
19 "Flight_Time_Minutes": [120],
20 "Price": [150],
21 "Day of the Week": [3],
22 "Destination": ["MCO"]
23})
24print(predictor.predict(X_test))
25
26import zipfile, shutil, pathlib
27from huggingface_hub import hf_hub_download
28import autogluon.tabular as ag
29
30zip_path = hf_hub_download(
31 repo_id="cassieli226/hw1-airline-automl",
32 filename="autogluon_predictor_dir.zip",
33 repo_type="model"
34)
35
36extract_dir = pathlib.Path("predictor_dir")
37if extract_dir.exists():
38 shutil.rmtree(extract_dir)
39with zipfile.ZipFile(zip_path, "r") as zf:
40 zf.extractall(str(extract_dir))
41
42predictor = ag.TabularPredictor.load(str(extract_dir))
43print(predictor.leaderboard(silent=True))
44