Closed vitorsrg closed 1 year ago
Just as a quick update: A tutorial is in the works and we've also also worked on improving the error messages for the next version.
Your example does not work because
Your example would therefore work when changing it to
import tensorflow_decision_forests as tfdf
import pandas as pd
df = pd.DataFrame(
[
[0.1, 1, 0.3],
[0.4, 1, 0.6],
[0.7, 0, 0.9],
[1.0, 0, 0.9],
],
columns=list("abc"))
ds = tfdf.keras.pd_dataframe_to_tf_dataset(
df,
label="a",
task=tfdf.keras.Task.NUMERICAL_UPLIFT)
model = tfdf.keras.RandomForestModel(
task=tfdf.keras.Task.NUMERICAL_UPLIFT,
uplift_treatment="b")
model.fit(ds)
But stay tuned for a full tutorial :)
Hi, thanks for the reply
The treatment column needs to be a 0 or 1 variable (does not have treatment or has treatment)
I was expecting NUMERICAL and CATEGORICAL uplift to have continuous and categorical/discrete treatment respectively. It would be helpful to have their differences and use cases explicit in the tutorial then
I was expecting NUMERICAL and CATEGORICAL uplift to have continuous and categorical/discrete treatment respectively
That's good to know, I've added a paragraph in the tutorial about the difference: Numerical and Categorical indeed specify the type of outcome, not the type of treatment in the problem.
The tutorial is now available in documentation/tutorials/uplift_colab.ipynb and will be available on the Tensorflow website once that's updated (a few days?) Happy to hear feedback!
Hi! Do you have a working snippet of uplift mode? I couldn't find any.
I've tried this very simple implementation:
However, it fails with the following output: