Contribution to scikit-learn: A Sample Pull Request by Reshama Shaikh

Posted by



Contributing to open-source projects is a great way to learn and grow as a programmer. In this tutorial, we will walk through the process of contributing to scikit-learn, one of the most popular machine learning libraries in Python. We will follow an example pull request outlined by Reshama Shaikh, a data scientist and educator.

Step 1: Set up your environment
Before you start contributing to scikit-learn, you need to set up your development environment. You will need to have Python and Git installed on your computer. You will also need to have scikit-learn cloned from the official repository using Git. You can follow the official instructions on how to set up your environment on the scikit-learn GitHub page.

Step 2: Understand the issue
Once you have set up your environment, you can search for an issue to work on. You can browse the issues on the scikit-learn GitHub page and look for an issue that interests you. In this example, we will be following Reshama’s example pull request, which involves adding a new parameter to a scikit-learn function.

Step 3: Make your changes
To make your changes, you will need to create a new branch in your Git repository. You can do this by running the following command in your terminal:
$ git checkout -b new_feature

Once you have created a new branch, you can make your changes to the scikit-learn codebase. In this example, we will be adding a new parameter to a function in scikit-learn. You can edit the relevant files in your code editor and make the necessary changes.

Step 4: Test your changes
Before you submit your pull request, you need to test your changes to make sure they work correctly. You can run the scikit-learn test suite by running the following command in your terminal:
$ python setup.py test

If the tests pass, you can proceed to the next step. If the tests fail, you will need to go back and fix the issues in your code.

Step 5: Submit your pull request
Once you have tested your changes, you can submit your pull request to the scikit-learn repository. You can do this by pushing your changes to your branch on GitHub and opening a pull request on the scikit-learn GitHub page.

In your pull request, you should provide a detailed description of the changes you made and why they are necessary. You should also reference the issue you are addressing and provide any relevant information that the scikit-learn developers might need to review your changes.

Step 6: Review and iterate
After you have submitted your pull request, the scikit-learn developers will review your changes and provide feedback. You may need to make further changes based on their feedback. This process may go back and forth several times until your changes are accepted.

Contributing to open-source projects like scikit-learn can be a rewarding experience. By following the example pull request outlined by Reshama Shaikh, you can learn the ins and outs of contributing to a large and complex codebase. Good luck with your contributions!

0 0 votes
Article Rating
8 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@yoututor96
1 month ago

thank you for the tutorial. do we really need to commit before run flake8 and pytest? also how did you fix the problem at 22:46 exactly? 🙂

@AnkurSingh-hd4ch
1 month ago

7:25 master is changed to main. git pull upstream main

@nackyding
1 month ago

Thank you. I'm new to contributing to OS projects so I decided skearn may be a good place to start since I use it regularly. Thank you again.

@amanbagrecha
1 month ago

thank you so much!

@pranjalmishra607
1 month ago

I'm really new to the open-source community, and I found this video really helpful. Thank You!!!!

@krumarnaudov
1 month ago

Really great and much needed! Thank you both for the video and for the transcript – it really helps first-time contributors overcome the initial block!

@sandeepa2879
1 month ago

I appreciate your time sharing these instructions, Reshama. This definitely helps the first-timers!

@AndreasMueller
1 month ago

Really awesome instructions! Thank you so much for preparing these!