Skip to content

Commit 17a6b10

Browse files
committed
Update contexttab snippet
1 parent 18ea01b commit 17a6b10

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ X, y = load_breast_cancer(return_X_y=True)
147147
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
148148
149149
# Initialize a classifier
150-
clf = ConTextTabClassifier(bagging=1, max_context_size=2048)
150+
# You can omit checkpoint and checkpoint_revision to use the default model
151+
clf = ConTextTabClassifier(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
151152
152153
clf.fit(X_train, y_train)
153154
@@ -174,7 +175,8 @@ y = df.target.astype(float)
174175
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
175176
176177
# Initialize the regressor
177-
regressor = ConTextTabRegressor(bagging=1, max_context_size=2048)
178+
# You can omit checkpoint and checkpoint_revision to use the default model
179+
regressor = ConTextTabRegressor(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
178180
179181
regressor.fit(X_train, y_train)
180182

0 commit comments

Comments
 (0)