Update README.md
Browse files
README.md
CHANGED
|
@@ -32,25 +32,20 @@ It also uses L1 regularization to reduce overfitting.
|
|
| 32 |
|
| 33 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 34 |
|
| 35 |
-
This
|
| 36 |
-
|
| 37 |
-
### Direct Use
|
| 38 |
-
|
| 39 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 40 |
-
|
| 41 |
-
The direct use would be to classify food as either Western or Asian based on an image.
|
| 42 |
|
| 43 |
### Out-of-Scope Use
|
| 44 |
|
| 45 |
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 46 |
|
| 47 |
-
If the dataset was expanded, this could be used to classify other types of
|
| 48 |
|
| 49 |
## Bias, Risks, and Limitations
|
| 50 |
|
| 51 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 52 |
|
| 53 |
-
This is trained off a small dataset of 30 original
|
|
|
|
| 54 |
|
| 55 |
### Recommendations
|
| 56 |
|
|
@@ -58,9 +53,43 @@ This is trained off a small dataset of 30 original photos and 300 augmented phot
|
|
| 58 |
|
| 59 |
The small dataset size means this model is not highly generalizable.
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
Use the code below to get started with the model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
## Training Details
|
| 66 |
|
|
|
|
| 32 |
|
| 33 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 34 |
|
| 35 |
+
This is used for classification of books as softcover or hardcover based on their measurements.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
### Out-of-Scope Use
|
| 38 |
|
| 39 |
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 40 |
|
| 41 |
+
If the dataset was expanded, this could be used to classify other types of books or a larger dataset.
|
| 42 |
|
| 43 |
## Bias, Risks, and Limitations
|
| 44 |
|
| 45 |
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 46 |
|
| 47 |
+
This is trained off a small dataset of 30 original books and 300 augmented rows.
|
| 48 |
+
This limited training dataset is liable to overfitting of the model and additional information is required to make it more robust.
|
| 49 |
|
| 50 |
### Recommendations
|
| 51 |
|
|
|
|
| 53 |
|
| 54 |
The small dataset size means this model is not highly generalizable.
|
| 55 |
|
| 56 |
+
### How to Get Started with the Model
|
| 57 |
|
| 58 |
Use the code below to get started with the model.
|
| 59 |
+
This code is from the 24-679 Lecture on tabular datasets.
|
| 60 |
+
|
| 61 |
+
Download the zipped native predictor directory
|
| 62 |
+
zip_local_path = huggingface_hub.hf_hub_download(
|
| 63 |
+
repo_id=MODEL_REPO_ID,
|
| 64 |
+
repo_type="model",
|
| 65 |
+
filename="autogluon_predictor_dir.zip",
|
| 66 |
+
local_dir=str(download_dir),
|
| 67 |
+
local_dir_use_symlinks=False
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
Unzip to a folder
|
| 71 |
+
native_dir = download_dir / "predictor_dir"
|
| 72 |
+
if native_dir.exists():
|
| 73 |
+
shutil.rmtree(native_dir)
|
| 74 |
+
native_dir.mkdir(parents=True, exist_ok=True)
|
| 75 |
+
|
| 76 |
+
with zipfile.ZipFile(zip_local_path, "r") as zf:
|
| 77 |
+
zf.extractall(str(native_dir))
|
| 78 |
+
|
| 79 |
+
Load native predictor
|
| 80 |
+
predictor_native = autogluon.tabular.TabularPredictor.load(str(native_dir))
|
| 81 |
+
|
| 82 |
+
Inference on synthetic test
|
| 83 |
+
X_test = df_synth_test.drop(columns=[TARGET_COL])
|
| 84 |
+
y_true = df_synth_test[TARGET_COL].reset_index(drop=True)
|
| 85 |
+
y_pred = predictor_native.predict(X_test).reset_index(drop=True)
|
| 86 |
+
|
| 87 |
+
Combine results
|
| 88 |
+
results = pandas.DataFrame({
|
| 89 |
+
"y_true": y_true,
|
| 90 |
+
"y_pred": y_pred
|
| 91 |
+
})
|
| 92 |
+
display(results)
|
| 93 |
|
| 94 |
## Training Details
|
| 95 |
|