Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ RUN pip install pysal && \
pip install -f https://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o && \
pip install tensorflow-gcs-config==2.6.0 && \
pip install tensorflow-addons==0.14.0 && \
pip install tensorflow_decision_forests==0.2.0 && \
/tmp/clean-layer.sh

RUN apt-get install -y libfreetype6-dev && \
Expand Down
18 changes: 18 additions & 0 deletions tests/test_tensorflow_decision_forests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import unittest

import numpy as np
import pandas as pd
import tensorflow_decision_forests as tfdf

class TestTensorflowDecisionForest(unittest.TestCase):
def test_fit(self):
train_df = pd.read_csv("/input/tests/data/train.csv")

# Convert the dataset into a TensorFlow dataset.
train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="label")

# Train the model
model = tfdf.keras.RandomForestModel(num_trees=1)
model.fit(train_ds)

self.assertEqual(1, model.count_params())