<jupyter_start><jupyter_text>Tensorflow Decision Forest (TFDF)  Import and Install dependecies<jupyter_code>!pip install tensorflow_decision_forests
!pip install pandas
import tensorflow_decision_forests as tfdf
import pandas as pd<jupyter_output><empty_output><jupyter_text>Loading Data<jupyter_code>train_df = pd.read_csv("/content/drive/Shareddrives/Capstone Victor/TFDF/train_data.csv")
test_df = pd.read_csv("/content/drive/Shareddrives/Capstone Victor/TFDF/test_data.csv")
train_df.pop("index")
test_df.pop("index")
train_df
train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="Disease")
test_ds = tfdf.keras.pd_dataframe_to_tf_dataset(test_df, label="Disease")<jupyter_output><empty_output><jupyter_text>Training and Evaluation<jupyter_code>model = tfdf.keras.RandomForestModel()
model.fit(train_ds)
# model.summary()
model.compile(metrics=["accuracy"])
print(model.evaluate(test_ds))
model.evaluate(test_ds)
tfdf.model_plotter.plot_model_in_colab(model, tree_idx=0)

predictions = model.predict(test_ds)
print(predictions)
len(predictions[0])
predictions
model.save("/content/drive/Shareddrives/Capstone Victor/TFDF")<jupyter_output>WARNING:absl:Function `_wrapped_model` contains input name(s) Symptom_1, Symptom_10, Symptom_11, Symptom_12, Symptom_13, Symptom_14, Symptom_15, Symptom_16, Symptom_17, Symptom_2, Symptom_3, Symptom_4, Symptom_5, Symptom_6, Symptom_7, Symptom_8, Symptom_9 with unsupported characters which will be renamed to symptom_1, symptom_10, symptom_11, symptom_12, symptom_13, symptom_14, symptom_15, symptom_16, symptom_17, symptom_2, symptom_3, symptom_4, symptom_5, symptom_6, symptom_7, symptom_8, symptom_9 in the SavedModel.
{'fraction_non_alphanumeric': 0.1044776119402985, 'fraction_numerical': 0.031044776119402984, 'mean_word_length': 10.173333333333334, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '519448', 'license': 'MIT', 'n_tokens_mistral': 671, 'n_tokens_neox': 607, 'n_words': 102, 'path': 'TFDF/Baseline_TFDF.ipynb', 'repo_name': 'musthofasyarifudin/Capstone_Bangkit', 'size': '1675'}