If the primitives that you want to add are not compliant with our fit-produce schema you will probably need to either add an adapter or modify an existing one in order to add them.
If you want to create a new adapter, please follow these steps:
If it does not exist yet, create a new GitHub issue requesting the primitive that requires it. As indicated previously, provide as many details as possible about the new primitive, like links to the documentation, what it does and what it is useful for, as well as details about why you think a new adapter is needed and how it would work.
Indicate in the issue description or in a comment that you are available to apply the changes yourself.
Wait for the feedback from the maintainers, who will approve the issue and assign it to you, before proceeding to implement any changes. Be open to discuss with them about the need of adding this primitive, as maybe there are other primitive that offer the same functionality, and about whether the adapter will be needed or not, or what is should look like.
Once the issue has been approved and assigned to you, implement the necessary changes in your own fork of the project. Please implement them in a branch named after the issue number and title, as this makes keeping track of the history of the project easier in the long run.
Create an adapter python module and add it to the mlstars/adapters/ directory. The name of the module should be the name of the library that you want to create an adapter for. For example, if you want to add an adapter to add primitives from the library called cool-ml, the name of the module should be mlstars/adapters/cool_ml.py. If the module already exists because there is another adapter for the same library, create the new adapter within the same module. Inside the adapter module, try to name the class or function that you create as similar as possible to the classes that you are writing the adapter for. For example, the adapter class for the keras.Sequential class is called mlstars.adapters.keras.Sequential, while the adapter class for the featuretools.dfs method is called mlstars.adapters.featuretools.DFS. As usual, when writing python code, make sure to follow a coding style consistent with the rest of the library, and to follow all the guidelines form the Contributing Guidelines section. Do not forget to properly document your code and cover it with proper unit testing! Create at least on JSON annotation that uses your adapter. When doing so, make sure to follow the corresponding conventions: The name of the file should correspond to the fully qualified name of the class or function that you are integrating ignoring the fact that you are using an adapter. For example, if you are adding the primitive CoolPrimitive from the module cool_ml.module by using the mlstars/adapters/cool_ml.CoolML adapter, the name of the file should be cool_ml.module.CoolPrimitive.json. Inside the JSON annotation, the primitive entry should have the fully qualified name of your adapter class, and the fixed hyperparameters should contain all the details that your adapter needs to know how to integrate the third party primitive. Add proper description of what the primitive does in the corresponding entry, as well as a link to its documentation. If there is no documentation available, put the link to its source code. And don’t forget to add you name and e-mail address to the contributors list! Add a pipeline annotation that uses your primitive inside the pipelines folder, named exactly like your primitive, and test it with the command mlstars test mlstars/pipelines/your.pipeline.json. If adding a pipeline is not possible for any reason, please inform the maintainers, as this probably means that a new dataset needs to be added.
Create an adapter python module and add it to the mlstars/adapters/ directory. The name of the module should be the name of the library that you want to create an adapter for. For example, if you want to add an adapter to add primitives from the library called cool-ml, the name of the module should be mlstars/adapters/cool_ml.py. If the module already exists because there is another adapter for the same library, create the new adapter within the same module.
mlstars/adapters/
cool-ml
mlstars/adapters/cool_ml.py
Inside the adapter module, try to name the class or function that you create as similar as possible to the classes that you are writing the adapter for. For example, the adapter class for the keras.Sequential class is called mlstars.adapters.keras.Sequential, while the adapter class for the featuretools.dfs method is called mlstars.adapters.featuretools.DFS.
keras.Sequential
mlstars.adapters.keras.Sequential
featuretools.dfs
mlstars.adapters.featuretools.DFS
As usual, when writing python code, make sure to follow a coding style consistent with the rest of the library, and to follow all the guidelines form the Contributing Guidelines section.
Do not forget to properly document your code and cover it with proper unit testing!
Create at least on JSON annotation that uses your adapter. When doing so, make sure to follow the corresponding conventions:
The name of the file should correspond to the fully qualified name of the class or function that you are integrating ignoring the fact that you are using an adapter. For example, if you are adding the primitive CoolPrimitive from the module cool_ml.module by using the mlstars/adapters/cool_ml.CoolML adapter, the name of the file should be cool_ml.module.CoolPrimitive.json. Inside the JSON annotation, the primitive entry should have the fully qualified name of your adapter class, and the fixed hyperparameters should contain all the details that your adapter needs to know how to integrate the third party primitive. Add proper description of what the primitive does in the corresponding entry, as well as a link to its documentation. If there is no documentation available, put the link to its source code. And don’t forget to add you name and e-mail address to the contributors list! Add a pipeline annotation that uses your primitive inside the pipelines folder, named exactly like your primitive, and test it with the command mlstars test mlstars/pipelines/your.pipeline.json. If adding a pipeline is not possible for any reason, please inform the maintainers, as this probably means that a new dataset needs to be added.
The name of the file should correspond to the fully qualified name of the class or function that you are integrating ignoring the fact that you are using an adapter. For example, if you are adding the primitive CoolPrimitive from the module cool_ml.module by using the mlstars/adapters/cool_ml.CoolML adapter, the name of the file should be cool_ml.module.CoolPrimitive.json.
CoolPrimitive
cool_ml.module
mlstars/adapters/cool_ml.CoolML
cool_ml.module.CoolPrimitive.json
Inside the JSON annotation, the primitive entry should have the fully qualified name of your adapter class, and the fixed hyperparameters should contain all the details that your adapter needs to know how to integrate the third party primitive.
primitive
fixed
Add proper description of what the primitive does in the corresponding entry, as well as a link to its documentation. If there is no documentation available, put the link to its source code. And don’t forget to add you name and e-mail address to the contributors list!
contributors
Add a pipeline annotation that uses your primitive inside the pipelines folder, named exactly like your primitive, and test it with the command mlstars test mlstars/pipelines/your.pipeline.json. If adding a pipeline is not possible for any reason, please inform the maintainers, as this probably means that a new dataset needs to be added.
mlstars test mlstars/pipelines/your.pipeline.json
Review your changes and make sure that everything continues to work properly by executing the make test-all command.
make test-all
Push all your changes to GitHub and open a Pull Request, indicating in the description which issue you are resolving and what the changes consist of.
If an adapter for the library already exists but it does not properly cover one of the primitives that you want to integrate, you might find that modifying the existing adapter adds this coverage.
In this case, if you are sure that these modifications will not break previous functionality, and the existing adapter can be safely modified, do the following steps:
If it does not exist yet, create a new GitHub issue requesting the primitive that requires it. As indicated previously, provide as many details as possible about the new primitive, like links to the documentation, what it does and what it is useful for, as well as details about why you think the current adapter needs to be modified and how.
Wait for the feedback from the maintainers, who will approve the issue and assign it to you, before proceeding to implement any changes. Be open to discuss with them about the need of adding this primitive, as maybe there are other primitive that offer the same functionality, and about whether the adapter can be modified or a new one created.
Do the necessary modifications in the existing adapter. As usual, when writing python code, make sure to follow a coding style consistent with the rest of the library, and to follow all the guidelines form the Contributing Guidelines section. Do not forget to properly document your code and cover it with proper unit testing! Create at least one new JSON annotation that uses the adapter. When doing so, make sure to follow the corresponding conventions: The name of the file should correspond to the fully qualified name of the class or function that you are integrating ignoring the fact that you are using an adapter. For example, if you are adding the primitive CoolPrimitive from the module cool_ml.module by using the mlstars/adapters/cool_ml.CoolML adapter, the name of the file should be cool_ml.module.CoolPrimitive.json. Inside the JSON annotation, the primitive entry should have the fully qualified name of your adapter class, and the fixed hyperparameters should contain all the details that your adapter needs to know how to integrate the third party primitive. Add proper description of what the primitive does in the corresponding entry, as well as a link to its documentation. If there is no documentation available, put the link to its source code. And don’t forget to add you name and e-mail address to the contributors list! Add a pipeline annotation that uses your primitive inside the pipelines folder, named exactly like your primitive, and test it with the command mlstars test mlstars/pipelines/your.pipeline.json. If adding a pipeline is not possible for any reason, please inform the maintainers, as this probably means that a new dataset needs to be added. Make sure that all the primitives that existed before that use the same adapter still work by testing their corresponding pipelines with the command above.
Do the necessary modifications in the existing adapter.
Create at least one new JSON annotation that uses the adapter. When doing so, make sure to follow the corresponding conventions:
The name of the file should correspond to the fully qualified name of the class or function that you are integrating ignoring the fact that you are using an adapter. For example, if you are adding the primitive CoolPrimitive from the module cool_ml.module by using the mlstars/adapters/cool_ml.CoolML adapter, the name of the file should be cool_ml.module.CoolPrimitive.json. Inside the JSON annotation, the primitive entry should have the fully qualified name of your adapter class, and the fixed hyperparameters should contain all the details that your adapter needs to know how to integrate the third party primitive. Add proper description of what the primitive does in the corresponding entry, as well as a link to its documentation. If there is no documentation available, put the link to its source code. And don’t forget to add you name and e-mail address to the contributors list! Add a pipeline annotation that uses your primitive inside the pipelines folder, named exactly like your primitive, and test it with the command mlstars test mlstars/pipelines/your.pipeline.json. If adding a pipeline is not possible for any reason, please inform the maintainers, as this probably means that a new dataset needs to be added. Make sure that all the primitives that existed before that use the same adapter still work by testing their corresponding pipelines with the command above.
Make sure that all the primitives that existed before that use the same adapter still work by testing their corresponding pipelines with the command above.