Recently, I posted a tip for creating and running projects on different features from the UI. This is really useful if, for example, you want to keep your dataset intact while also building models from just a subset of its features.
In this tip, I explain how you can do this also from the Python or R API. (See API documentation home for help using the DataRobot API.)
pandas_dataset = dr.Dataset.create_from_in_memory_data(data_frame=df)
project = pandas_dataset.create_project(project_name = "Project_Name")
Decide what features you want to include in your new feature list. For instance, I decided to create a feature list from the first 5 features from my original dataset and name it “Cleaned.”
feature_list = list(df.columns)[0:5]
Upload the new feature list (“Cleaned,” in this example) to your project.
cleaned_ft = project.create_featurelist("Cleaned",feature_list)
project.set_target(target= target_name,mode =
dr.enums.AUTOPILOT_MODE.FULL_AUTO, featurelist_id=cleaned_ft.id,
#You need the feature list id here
autopilot_with_feature_discovery= True,
max_wait=10000,
worker_count = -1)
project <- SetupProject(df, projectName = “Project_Name”, maxWait = 60 * 60)
Features2keep <- names(df)[1:5]
featureList <- CreateFeaturelist(project,”Feature_List_Name”, feature2keep)
SetTarget(project = project,target= “TargetName”, featurelistId = featureList$featurelistId)
I hope you find this tip helpful. Please Kudo or add a comment to let me know. thanks! Dalila @dalilaB