Skip to content

Commit 01fa3fd

Browse files
committed
Update hyperparameter.md
1 parent 758b2c4 commit 01fa3fd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/source/examples/hyperparameter.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ ray.init()
7575

7676
A codeflare pipeline is defined by EstimatorNodes and edges connecting two EstimatorNodes. In this case, we define node_pca and node_logistic and we connect these two nodes with `pipeline.add_edge()`. Before we can execute `fit()` on a pipeline, we need to set up the proper input to the pipeline.
7777

78+
```python
79+
pca = PCA()
80+
# set the tolerance to a large value to make the example faster
81+
logistic = LogisticRegression(max_iter=10000, tol=0.1)
82+
pipeline = dm.Pipeline()
83+
node_pca = dm.EstimatorNode('pca', pca)
84+
node_logistic = dm.EstimatorNode('logistic', logistic)
85+
pipeline.add_edge(node_pca, node_logistic)
86+
# input to pipeline
87+
pipeline_input = dm.PipelineInput()
88+
pipeline_input.add_xy_arg(node_pca, dm.Xy(X_digits, y_digits))
89+
```
90+
7891
#### **Step 3: defining pipeline param grid and executing**
7992

8093
Codeflare pipelines grid_search_cv()

0 commit comments

Comments
 (0)