Skip to content

Commit c1c1a93

Browse files
authored
Feature/v1.0.0 (#8)
* update xgboost Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com> * update sentiment classification Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com> * update sentiment classification Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com> * update robotarm anomaly detection Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com> * update auto mpg regression Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com> * update object detection Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com> --------- Signed-off-by: Aiden-Jeon <aiden.jongseob@gmail.com>
1 parent 561f48d commit c1c1a93

19 files changed

Lines changed: 923 additions & 798 deletions

File tree

-703 KB
Loading
-16.7 KB
Loading
-571 KB
Loading

tutorial/auto_mpg_regression/README.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,29 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
2424

2525
## Runway
2626

27-
### 데이터셋 생성
28-
2927
> 📘 이 튜토리얼은 UC Irvine에서 제공하는 1970년대 후반과 1980년대 초반에 출시된 자동차의 정보가 포함된 AutoMPG 데이터 세트를 사용합니다.
3028
> 해당 데이터 세트에는 개별 자동차의 실린더 수, 배기량, 마력, 공차 중량, 제조국 등의 특성이 포함되어있습니다.
3129
>
3230
> AutoMPG 데이터셋은 아래 항목을 클릭하여 다운로드할 수 있습니다.
3331
> **[auto-mpg.csv](https://runway-tutorial.s3.ap-northeast-2.amazonaws.com/auto-mpg.csv)**
3432
33+
### 데이터 세트 생성하기
34+
35+
> 📘 데이터셋 생성에 관한 자세한 내용은 [공식 문서](https://docs.live.mrxrunway.ai/Guide/ml_development/datasets/dataset-runway/)를 참고하세요.
36+
3537
1. Runway 프로젝트 메뉴에서 데이터셋 페이지로 이동합니다.
36-
2. 데이터셋 페이지에서 신규 데이터셋을 생성합니다.
37-
3. 데이터셋 페이지의 우측 상단 `Create Dataset`을 클릭합니다.
38-
4. Local file을 클릭합니다.
39-
5. 저장하는 데이터셋의 이름과 설명을 입력합니다.
40-
6. 데이터셋으로 생성할 파일을 파일 탐색기로 선택하거나, Drag&Drop으로 입력합니다.
41-
7. `Create`를 클릭합니다.
38+
2. 데이터 세트 메뉴에서 데이터 세트 생성 메뉴에 진입합니다.
39+
- 좌측 데이터 세트 목록 상단 `+` 버튼을 클릭합니다.
40+
- 초기 화면에서 `Create` 버튼을 클릭합니다.
41+
3. 다이얼로그에서 생성할 데이터 세트의 이름을 입력 후 `Create` 버튼을 클릭합니다.
42+
43+
### 데이터 세트 버전 생성하기
44+
45+
1. `Versions 섹션`에서 `Create version` 버튼을 클릭합니다.
46+
2. 다이얼로그에서 `Local file`을 선택합니다.
47+
3. 저장하는 데이터셋의 이름과 설명을 입력합니다.
48+
4. 데이터셋으로 생성할 파일을 파일 탐색기로 선택하거나, Drag&Drop으로 입력합니다.
49+
5. `Create`를 클릭합니다.
4250

4351
## Link
4452

@@ -53,11 +61,13 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
5361

5462
#### 데이터 불러오기
5563

56-
> 📘 데이터 세트 불러오는 방법에 대한 구체적인 가이드는 **[데이터 세트 가져오기](https://docs.mrxrunway.ai/docs/데이터-세트-가져오기)** 가이드 에서 확인할 수 있습니다.
57-
58-
1. Runway 코드 스니펫 메뉴의 **import dataset**을 이용해 프로젝트에 등록되어 있는 데이터셋 목록을 불러옵니다.
59-
2. 생성한 데이터셋을 선택해서 코드를 생성합니다.
64+
> 📘 데이터 세트 불러오는 방법에 대한 구체적인 가이드는 **[데이터 세트 가져오기](https://docs.live.mrxrunway.ai/Guide/ml_development/dev_instances/%EB%8D%B0%EC%9D%B4%ED%84%B0_%EC%84%B8%ED%8A%B8_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0/)** 가이드 에서 확인할 수 있습니다.
6065

66+
1. 노트북 셀 상단의 **Add Runway Snippet** 버튼을 클릭합니다.
67+
2. **Import Dataset** 를 선택합니다.
68+
3. 사용할 데이터 세트의 버전을 선택하고 **Save** 버튼을 클릭합니다.
69+
4. 버튼 클릭 시 노트북 셀 내 선택한 데이터 세트 내 파일 목록을 조회할 수 있는 스니펫이 작성되며, 해당 데이터 세트 경로를 값으로 갖는 데이터 세트 파라미터가 추가됩니다.
70+
5. 데이터 세트를 불러오고자 하는 노트북 셀에서 등록된 데이터 세트 파라미터의 이름을 입력하여 작업에 활용합니다.
6171
```python
6272
import os
6373
import pandas as pd
@@ -78,16 +88,15 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
7888
#### 데이터 전처리
7989

8090
1. 데이터 세트에 포함된 결측치 값을 제거하고, 학습 특성 데이터 세트와 목표 특성 데이터 세트를 분리합니다.
81-
8291
```python
83-
## Drop NA data in dataset
84-
data_clean= df.dropna()
92+
# Drop NA data in dataset
93+
data_clean = df.dropna()
8594

86-
## Select Predictor columns
87-
X = df[['cylinders', 'displacement', 'weight', 'acceleration', "origin"]]
95+
# Select Predictor columns
96+
X = df[["cylinders", "displacement", "weight", "acceleration", "origin"]]
8897

89-
## Select target column
90-
y = df['mpg']
98+
# Select target column
99+
y = df["mpg"]
91100
```
92101

93102
2. 데이터셋을 학습용 데이터셋과 테스트용 데이터셋으로 분리합니다.
@@ -96,7 +105,7 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
96105
from sklearn.model_selection import train_test_split
97106

98107
## Split data into training and testing sets
99-
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2)
108+
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2, random_state=2024)
100109
```
101110

102111
### 모델
@@ -132,12 +141,9 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
132141
#### 모델 학습
133142

134143
1. 선언한 모델 클래스와 학습용 데이터셋을 활용하여, 모델의 학습과 관련 정보를 로깅합니다.
135-
136144
```python
137-
import runway
138145
from sklearn.metrics import mean_squared_error
139146

140-
runway.start_run()
141147

142148
runway_regressor = RunwayRegressor()
143149
runway_regressor.fit(X_train, y_train)
@@ -148,21 +154,22 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
148154
#Mean Squared error on the testing set
149155
mse = mean_squared_error(valid_pred, y_valid)
150156

151-
runway.log_metric("mse", mse)
152157
#Print evaluate model score
153-
print('Mean Squared Error: {}'.format(mse))
158+
print("Mean Squared Error: {}".format(mse))
154159
```
155160

156161
### 모델 업로드
157162

158-
> 📘 모델 업로드 방법에 대한 구체적인 가이드는 **[모델 업로드](https://docs.mrxrunway.ai/docs/%EB%AA%A8%EB%8D%B8-%EC%97%85%EB%A1%9C%EB%93%9C)** 문서에서 확인할 수 있습니다.
163+
> 📘 모델 업로드 방법에 대한 구체적인 가이드는 **[모델 업로드](https://docs.live.mrxrunway.ai/Guide/ml_development/dev_instances/%EB%AA%A8%EB%8D%B8_%EC%97%85%EB%A1%9C%EB%93%9C/)** 문서에서 확인할 수 있습니다.
159164

160165
1. Runway code snippet 의 save model을 사용해 모델을 저장하는 코드를 생성합니다.
161166
2. 생성된 코드에 필요한 input_sample 을 작성합니다.
162-
163167
```python
164168
import runway
165169

170+
runway.start_run()
171+
runway.log_metric("mse", mse)
172+
166173
input_sample = X_train.sample(1)
167174

168175
runway.log_model(model_name="auto-mpg-reg-model-sklearn", model=runway_regressor, input_samples={"predict": input_sample})
@@ -171,15 +178,13 @@ Runway에 포함된 Link를 사용하여 테이블 형식 데이터 세트를
171178

172179
## 파이프라인 구성 및 저장
173180

174-
> 📘 파이프라인 생성 방법에 대한 구체적인 가이드는 **[파이프라인 생성](https://docs.mrxrunway.ai/docs/파이프라인-생성)** 문서에서 확인할 수 있습니다.
175-
176-
1. 파이프라인으로 구성할 코드 셀을 선택하여 컴포넌트로 설정합니다.
177-
2. 파이프라인으로 구성이 완료되면, 전체 파이프라인을 실행하여 정상 동작 여부를 확인합니다.
178-
3. 파이프라인의 정상 동작 확인 후, 파이프라인을 Runway에 저장합니다.
179-
1. 좌측 패널 영역의 Upload Pipeline을 클릭합니다.
180-
2. Pipeline 저장 옵션을 선택합니다.
181-
1. 신규 저장의 경우, New Pipeline을 선택합니다.
182-
2. 기존 파이프라인의 업데이트일 경우, Version Update를 선택합니다.
183-
3. 파이프라인 저장을 위한 값을 입력 후, Save를 클릭합니다.
184-
4. Runway 프로젝트 메뉴에서 Pipeline 페이지로 이동합니다.
185-
5. 저장한 파이프라인의 이름을 클릭하면 파이프라인 상세 페이지로 진입합니다.
181+
> 📘 파이프라인 생성 방법에 대한 구체적인 가이드는 **[파이프라인 업로드](https://docs.live.mrxrunway.ai/Guide/ml_development/dev_instances/%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8_%EC%97%85%EB%A1%9C%EB%93%9C/)** 문서에서 확인할 수 있습니다.
182+
183+
1. **Link**에서 파이프라인을 작성하고 정상 실행 여부를 확인합니다.
184+
2. 정상 실행 확인 후, Link pipeline 패널의 **Upload pipeline** 버튼을 클릭합니다.
185+
3. **New Pipeline** 버튼을 클릭합니다.
186+
4. **Pipeline** 필드에 Runway에 저장할 이름을 작성합니다.
187+
5. **Pipeline version** 필드에는 자동으로 버전 1이 선택됩니다.
188+
6. **Upload** 버튼을 클릭합니다.
189+
7. 업로드가 완료되면 프로젝트 내 Pipeline 페이지에 업로드한 파이프라인 항목이 표시됩니다.
190+

tutorial/auto_mpg_regression/README_en.md

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,28 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
2424

2525
## Runway
2626

27-
### Create dataset
28-
2927
> We will use the AutoMPG dataset, which contains information about cars released in the late 1970s and early 1980s, including attributes such as the number of cylinders, displacement, horsepower, weight, and origin.
3028
>
3129
> You can download the AutoMPG dataset using the following link:
3230
> **[auto-mpg.csv](https://runway-tutorial.s3.ap-northeast-2.amazonaws.com/auto-mpg.csv)**
3331
34-
1. Go to the Runway project menu and navigate to the dataset page.
35-
2. Create a new dataset on the dataset page.
36-
3. Click on the `Create Dataset` button in the top right corner.
37-
4. Select `Local File`.
38-
5. Provide a name and description for the dataset you are creating.
39-
6. Choose the file to include in the dataset using the file explorer or drag-and-drop.
40-
7. Click on `Create`.
32+
### Create a dataset
33+
34+
> 📘 For detailed information on dataset creation, please refer to the [official documentation](https://docs.live.mrxrunway.ai/en/Guide/ml_development/datasets/dataset-runway/).
35+
36+
1. Navigate to the dataset page from the Runway project menu.
37+
2. Access the dataset creation menu in the dataset menu.
38+
- Click the `+` button at the top of the left dataset list.
39+
- Click the `Create` button on the initial screen.
40+
3. In the dialog, enter the name of the dataset to create and click the `Create` button.
41+
42+
### Creating Dataset Version
43+
44+
1. Click the `Create version` button in the `Versions` section.
45+
2. Select `Local file` in the dialog.
46+
3. Enter the name and description of the dataset to be saved.
47+
4. Select the file to be created as a dataset using the file explorer or Drag&Drop.
48+
5. Click `Create`.
4149

4250
## Link
4351

@@ -52,11 +60,13 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
5260

5361
#### Load Data
5462

55-
> 📘 You can find detailed instructions on how to load the dataset in the [Import Dataset](https://docs.mrxrunway.ai/v0.13.0-Eng/docs/import-dataset).
56-
57-
1. Use the Runway code snippet menu to import the list of datasets registered in your project.
58-
2. Select the created dataset and generate code
63+
> 📘 You can find detailed instructions on how to load the dataset in the [Import Dataset](https://docs.live.mrxrunway.ai/en/Guide/ml_development/dev_instances/%EB%8D%B0%EC%9D%B4%ED%84%B0_%EC%84%B8%ED%8A%B8_%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0/).
5964

65+
1. Click the **Add Runway Snippet** button at the top of the notebook cell.
66+
2. Select **Import Dataset**.
67+
3. Choose the version of the dataset you want to use and click **Save**.
68+
4. Upon clicking the button, a snippet will be generated in the notebook cell allowing you to browse the files within the selected dataset. Additionally, a dataset parameter with the dataset path as its value will be added.
69+
5. Utilize the name of the registered dataset parameter in the notebook cell where you want to load the dataset.
6070
```python
6171
import os
6272
import pandas as pd
@@ -77,16 +87,15 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
7787
#### Data Preprocessing
7888

7989
1. Remove any missing values in the dataset and separate the predictor and target columns.
80-
8190
```python
82-
## Drop NA data in dataset
83-
data_clean= df.dropna()
91+
# Drop NA data in dataset
92+
data_clean = df.dropna()
8493

85-
## Select Predictor columns
86-
X = df[['cylinders', 'displacement', 'weight', 'acceleration', "origin"]]
94+
# Select Predictor columns
95+
X = df[["cylinders", "displacement", "weight", "acceleration", "origin"]]
8796

88-
## Select target column
89-
y = df['mpg']
97+
# Select target column
98+
y = df["mpg"]
9099
```
91100

92101
2. Split the dataset into training and testing sets.
@@ -95,7 +104,7 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
95104
from sklearn.model_selection import train_test_split
96105

97106
#Split data into training and testing sets
98-
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2)
107+
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2, random_state=2024)
99108
```
100109

101110
#### Model
@@ -131,12 +140,9 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
131140
#### Model Training
132141

133142
1. Use the declared model class and the training dataset to train the model, and log the information related to train.
134-
135143
```python
136-
import runway
137144
from sklearn.metrics import mean_squared_error
138145

139-
runway.start_run()
140146

141147
runway_regressor = RunwayRegressor()
142148
runway_regressor.fit(X_train, y_train)
@@ -147,21 +153,21 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
147153
#Mean Squared error on the testing set
148154
mse = mean_squared_error(valid_pred, y_valid)
149155

150-
runway.log_metric("mse", mse)
151156
#Print evaluate model score
152-
print('Mean Squared Error: {}'.format(mse))
157+
print("Mean Squared Error: {}".format(mse))
153158
```
154159

155160
### Upload Model
156161

157-
> 📘 You can find detailed instructions on how to save the model in the [Upload Model](https://docs.mrxrunway.ai/v0.13.1-Eng/docs/upload-model).
158-
159-
1. Use the "save model" option from the Runway code snippet to save the model.
162+
> 📘 You can find detailed instructions on how to save the model in the [Upload Model](https://docs.live.mrxrunway.ai/en/Guide/ml_development/dev_instances/%EB%AA%A8%EB%8D%B8_%EC%97%85%EB%A1%9C%EB%93%9C/).
163+
1. Use the `save model` option from the Runway code snippet to save the model.
160164
2. Create a sample input data for the generated code.
161-
162165
```python
163166
import runway
164167

168+
runway.start_run()
169+
runway.log_metric("mse", mse)
170+
165171
input_sample = X_train.sample(1)
166172

167173
runway.log_model(model_name="auto-mpg-reg-model-sklearn", model=runway_regressor, input_samples={"predict": input_sample})
@@ -170,15 +176,13 @@ In this tutorial, we will perform tabular regression on the AutoMPG dataset usin
170176

171177
## Pipeline Configuration and Saving
172178

173-
> 📘 For specific guidance on creating a pipeline, refer to the [Create Pipeline](https://docs.mrxrunway.ai/v0.13.0-Eng/docs/create-pipeline).
174-
175-
1. Select the code cells to be included in the pipeline and configure them as components.
176-
2. Once the pipeline is complete, run the entire pipeline to verify that it works correctly.
177-
3. After confirming the pipeline's successful operation, save the pipeline in Runway.
178-
1. Click on "Upload Pipeline" in the left panel area.
179-
2. Choose the pipeline saving option:
180-
1. For new pipeline, select "New Pipeline."
181-
2. For updating an existing pipeline, select "Update Version"
182-
3. Provide the necessary information to save the pipeline.
183-
4. Go back to Runway project page, and click Pipeline.
184-
5. You can now access the saved pipeline in the Runway project menu under the Pipeline page.
179+
> 📘 For specific guidance on creating a pipeline, refer to the [Upload Pipeline](https://docs.live.mrxrunway.ai/en/Guide/ml_development/dev_instances/%ED%8C%8C%EC%9D%B4%ED%94%84%EB%9D%BC%EC%9D%B8_%EC%97%85%EB%A1%9C%EB%93%9C/).
180+
181+
1. Write and verify the pipeline in **Link** to ensure it runs smoothly.
182+
2. After verifying successful execution, click the **Upload pipeline** button in the Link pipeline panel.
183+
3. Click the **New Pipeline** button.
184+
4. Enter the name for the pipeline to be saved in Runway in the **Pipeline** field.
185+
5. The **Pipeline version** field will automatically select version 1.
186+
6. Click the **Upload** button.
187+
7. Once the upload is complete, the uploaded pipeline item will appear on the Pipeline page within the project.
188+

tutorial/auto_mpg_regression/auto_mpg_regression.ipynb

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@
8585
},
8686
"outputs": [],
8787
"source": [
88-
"#Drop NA data in dataset\n",
89-
"data_clean= df.dropna()\n",
88+
"# Drop NA data in dataset\n",
89+
"data_clean = df.dropna()\n",
9090
"\n",
91-
"#Select Predictor columns\n",
92-
"X = df[['cylinders', 'displacement', 'weight', 'acceleration', \"origin\"]]\n",
91+
"# Select Predictor columns\n",
92+
"X = df[[\"cylinders\", \"displacement\", \"weight\", \"acceleration\", \"origin\"]]\n",
9393
"\n",
94-
"#Select target column\n",
95-
"y = df['mpg']"
94+
"# Select target column\n",
95+
"y = df[\"mpg\"]"
9696
]
9797
},
9898
{
@@ -123,7 +123,7 @@
123123
"from sklearn.model_selection import train_test_split\n",
124124
"\n",
125125
"#Split data into training and testing sets\n",
126-
"X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2)"
126+
"X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2, random_state=2024)"
127127
]
128128
},
129129
{
@@ -198,10 +198,8 @@
198198
},
199199
"outputs": [],
200200
"source": [
201-
"import runway\n",
202201
"from sklearn.metrics import mean_squared_error\n",
203202
"\n",
204-
"runway.start_run()\n",
205203
"\n",
206204
"runway_regressor = RunwayRegressor()\n",
207205
"runway_regressor.fit(X_train, y_train)\n",
@@ -212,7 +210,6 @@
212210
"#Mean Squared error on the testing set\n",
213211
"mse = mean_squared_error(valid_pred, y_valid)\n",
214212
"\n",
215-
"runway.log_metric(\"mse\", mse)\n",
216213
"#Print evaluate model score\n",
217214
"print('Mean Squared Error: {}'.format(mse))"
218215
]
@@ -244,6 +241,9 @@
244241
"source": [
245242
"import runway\n",
246243
"\n",
244+
"runway.start_run()\n",
245+
"runway.log_metric(\"mse\", mse)\n",
246+
"\n",
247247
"input_sample = X_train.sample(1)\n",
248248
"\n",
249249
"runway.log_model(model_name=\"auto-mpg-reg-model-sklearn\", model=runway_regressor, input_samples={\"predict\": input_sample})\n",
@@ -268,23 +268,15 @@
268268
"parameters": [
269269
{
270270
"metadata": {
271-
"resource_id": 192,
272-
"resource_name": "auto-mpg",
273-
"resource_type": "runway_dataset"
274-
},
275-
"name": "TRAIN_DATA",
276-
"type": "str",
277-
"value": "\"/home/jovyan/workspace/dataset/auto-mpg\""
278-
},
279-
{
280-
"metadata": {
281-
"resource_id": 192,
282-
"resource_name": "auto-mpg",
271+
"dataset_version_id": 569,
272+
"is_latest": true,
273+
"resource_id": 587,
274+
"resource_name": "train-data",
283275
"resource_type": "runway_dataset"
284276
},
285277
"name": "RUNWAY_DATA_PATH",
286278
"type": "str",
287-
"value": "\"/home/jovyan/workspace/dataset/auto-mpg\""
279+
"value": "\"/home/jovyan/workspace/dataset/train-data/latest\""
288280
}
289281
],
290282
"version": "1.0"

0 commit comments

Comments
 (0)