File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ RUN pip install pysal && \
169169 pip install -f https://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o && \
170170 pip install tensorflow-gcs-config==2.6.0 && \
171171 pip install tensorflow-addons==0.14.0 && \
172+ pip install tensorflow_decision_forests==0.2.0 && \
172173 /tmp/clean-layer.sh
173174
174175RUN apt-get install -y libfreetype6-dev && \
Original file line number Diff line number Diff line change 1+ import unittest
2+
3+ import numpy as np
4+ import pandas as pd
5+ import tensorflow_decision_forests as tfdf
6+
7+ class TestTensorflowDecisionForest (unittest .TestCase ):
8+ def test_fit (self ):
9+ train_df = pd .read_csv ("/input/tests/data/train.csv" )
10+
11+ # Convert the dataset into a TensorFlow dataset.
12+ train_ds = tfdf .keras .pd_dataframe_to_tf_dataset (train_df , label = "label" )
13+
14+ # Train the model
15+ model = tfdf .keras .RandomForestModel (num_trees = 1 )
16+ model .fit (train_ds )
17+
18+ self .assertEqual (1 , model .count_params ())
You can’t perform that action at this time.
0 commit comments