The below documentation describes the foundry_ml
library which is no longer recommended for use in the platform. Instead, use the palantir_models
library. You can also learn how to migrate a model from the foundry_ml
to the palantir_models
framework through an example.
The foundry_ml
library will be removed on October 31, 2025, corresponding with the planned deprecation of Python 3.9.
While Foundry is designed to operate with any machine learning library, it comes pre-packaged with support for a few of the more popular libraries. These libraries operate seamlessly with the ecosystem and have official compatibility guarantees.
To assist with writing models in these libraries and leveraging the parameter options, the foundry_ml
library provides a helper function, foundry_ml.help
,
to expose relevant metadata around certain classes.
In the code below, suppose you are training a scikit-learn RandomForest
and want to know what parameter options you can change when creating a Stage
for your random forest.
Copy and paste this code in a Code Workbook Console.
Copied!1 2 3 4
import foundry_ml from sklearn.ensemble import RandomForestClassifier foundry_ml.help(RandomForestClassifier)
The output will be in this format:
Copied!1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
""" Transform Docstring Args: param2: (Required) Param2 Docstring param1: (Optional) Param1 Docstring param3: (Optional default=Default) Param3 Docstring **Input** Inputspec Docstring **Output** Outputspec Docstring """
help
will return None
if the class isn't supported out of the box.