|
1 |
| -# SKLearn XAI Components Library |
2 | 1 |
|
3 |
| -This library provides a collection of components for working with scikit-learn models, datasets, and evaluation tools within the XAI framework. It includes components for loading datasets, data preprocessing, model training, evaluation, and various machine learning algorithms. |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +<p align="center"> |
| 6 | + <a href="https://github.com/XpressAI/xircuits/tree/master/xai_components#xircuits-component-library-list">Component Libraries</a> • |
| 7 | + <a href="https://github.com/XpressAI/xircuits/tree/master/project-templates#xircuits-project-templates-list">Project Templates</a> |
| 8 | + <br> |
| 9 | + <a href="https://xircuits.io/">Docs</a> • |
| 10 | + <a href="https://xircuits.io/docs/Installation">Install</a> • |
| 11 | + <a href="https://xircuits.io/docs/category/tutorials">Tutorials</a> • |
| 12 | + <a href="https://xircuits.io/docs/category/developer-guide">Developer Guides</a> • |
| 13 | + <a href="https://github.com/XpressAI/xircuits/blob/master/CONTRIBUTING.md">Contribute</a> • |
| 14 | + <a href="https://www.xpress.ai/blog/">Blog</a> • |
| 15 | + <a href="https://discord.com/invite/vgEg2ZtxCw">Discord</a> |
| 16 | +</p> |
| 17 | + |
| 18 | +<p align="center"> |
| 19 | +<img src= https://github.com/user-attachments/assets/2eb68c60-d3b6-4209-8297-903874db8ab5 |
| 20 | +" width="450"/> |
| 21 | +</p> |
| 22 | + |
| 23 | +<p align="center"><i>Xircuits Component Library for integrating scikit-learn models, datasets, and evaluation tools.</i></p> |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Welcome to the SKLearn XAI Components Library |
| 28 | + |
| 29 | +The **SKLearn XAI Components Library** provides a simple and intuitive way to integrate **scikit-learn** machine learning models, datasets, and evaluation tools within the **XAI** framework. With this library, you can easily manage the end-to-end workflow for data handling, model training, and evaluation using scikit-learn's extensive set of algorithms and features. |
| 30 | + |
| 31 | +In this guide, you will find the steps to install the library, set up a workflow, and get started with training and evaluating machine learning models. |
| 32 | + |
| 33 | +## Table of Contents |
| 34 | + |
| 35 | +- [Prerequisites](#prerequisites) |
| 36 | +- [Installation](#installation) |
| 37 | +- [Getting Started with SKLearn XAI Components](#getting-started-with-sklearn-xai-components) |
| 38 | + - [Example Workflow: RandomForestClassifier](#example-workflow-randomforestclassifier) |
| 39 | +- [Components Overview](#components-overview) |
| 40 | + - [Dataset Handling](#dataset-handling) |
| 41 | + - [Data Preprocessing](#data-preprocessing) |
| 42 | + - [Model Training](#model-training) |
| 43 | + - [Model Evaluation](#model-evaluation) |
| 44 | +- [Contributing](#contributing) |
4 | 45 |
|
5 | 46 | ## Prerequisites
|
6 | 47 |
|
7 |
| -- Python 3.8 or higher |
8 |
| -- scikit-learn |
9 |
| -- pandas (for CSV data handling) |
| 48 | +Before using this library, you’ll need the following: |
| 49 | + |
| 50 | +1. **Python 3.8** or higher |
| 51 | +2. **scikit-learn**: Core machine learning algorithms |
| 52 | +3. **pandas**: For handling CSV and tabular data |
| 53 | +4. **Xircuits**: To integrate the components into your workflows |
| 54 | + |
| 55 | + |
10 | 56 |
|
11 | 57 | ## Installation
|
12 | 58 |
|
13 |
| -You can install the required libraries using pip: |
| 59 | +To use this component library, ensure that you have an existing [Xircuits setup](https://xircuits.io/docs/main/Installation). You can then install the SKLearn library using the [component library interface](https://xircuits.io/docs/component-library/installation#installation-using-the-xircuits-library-interface), or through the CLI using: |
14 | 60 |
|
15 |
| -```bash |
16 |
| -pip install -r requirements.txt |
| 61 | +``` |
| 62 | +xircuits install sklearn |
17 | 63 | ```
|
18 | 64 |
|
19 |
| -To use this component library, simply copy the directory / clone or submodule the repository to your working Xircuits project directory. |
| 65 | +You can also do it manually by cloning and installing it. |
20 | 66 |
|
21 |
| -## Components Overview |
| 67 | +```bash |
| 68 | +# To clone the repository into your Xircuits project directory |
| 69 | +git clone https://github.com/XpressAI/xai-sklearn.git xai_components/xai_sklearn |
| 70 | + |
| 71 | +# Install required dependencies |
| 72 | +pip install -r xai_components/xai_sklearn/requirements.txt |
| 73 | +``` |
22 | 74 |
|
23 |
| -The library includes a variety of components categorized into dataset handling, data preprocessing, model training, and model evaluation. |
| 75 | +## Getting Started with SKLearn XAI Components |
24 | 76 |
|
25 |
| -### Dataset Handling |
26 | 77 |
|
27 |
| -- **`SKLearnLoadDataset`**: Fetches datasets from scikit-learn's dataset collection. |
28 |
| -- **`CSVToSKLearnDataset`**: Converts a CSV file into a format compatible with scikit-learn datasets. |
29 | 78 |
|
30 |
| -### Data Preprocessing |
| 79 | +Now that you have installed the required libraries and components, you can begin using the SKLearn XAI Components Library to build machine learning workflows in Xircuits. Please follow the documentation and examples provided in the library to learn how to create, customize, and manage machine learning components using SKLearn XAI. |
31 | 80 |
|
32 |
| -- **`SKLearnTrainTestSplit`**: Splits datasets into training and testing sets. |
33 | 81 |
|
34 |
| -### Model Training |
| 82 | +## Try the Example |
35 | 83 |
|
36 |
| -- **`SKLearnModelTraining`**: Trains a specified scikit-learn model using provided training data. |
37 |
| -- **`SKLearnRandomForestClassifier`**: Initializes a RandomForestClassifier model. |
38 |
| -- **`SKLearnLogisticRegression`**: Initializes a LogisticRegression model. |
39 |
| -- **`SKLearnSVC`**: Initializes a Support Vector Classifier (SVC) model. |
40 |
| -- **`SKLearnKNeighborsClassifier`**: Initializes a KNeighborsClassifier model. |
41 |
| -- **`SKLearnDecisionTreeClassifier`**: Initializes a DecisionTreeClassifier model. |
42 |
| -- **`SKLearnGradientBoostingClassifier`**: Initializes a GradientBoostingClassifier model. |
43 |
| -- **`SKLearnSVR`**: Initializes a Support Vector Regression (SVR) model. |
44 |
| -- **`SKLearnMultinomialNB`**: Initializes a Multinomial Naive Bayes (MultinomialNB) model. |
45 |
| -- **`SKLearnRidgeRegression`**: Initializes a Ridge Regression model. |
46 |
| -- **`SKLearnKMeans`**: Initializes a KMeans clustering model. |
| 84 | +We have provided an example workflow to help you get started with the SKLearn XAI Components Library. Give it a try and see how you can create a custom machine learning workflow for your projects. |
47 | 85 |
|
48 |
| -### Model Evaluation |
| 86 | +### Train Evaluate |
49 | 87 |
|
50 |
| -- **`SKLearnClassificationEvaluation`**: Evaluates a trained scikit-learn classification model using testing data. |
| 88 | +This example demonstrates a machine learning workflow in Xircuits using the SKLearn XAI Components Library. It creates a pipeline for loading the Iris dataset, splitting it, training a RandomForestClassifier, and evaluating its performance |
51 | 89 |
|
52 |
| -## Usage |
53 | 90 |
|
54 |
| -Each component can be integrated into your XAI workflows as needed. For instance, to train a RandomForestClassifier model: |
| 91 | +## Components Library |
55 | 92 |
|
56 |
| -1. Load your dataset using `SKLearnLoadDataset` or `CSVToSKLearnDataset`. |
57 |
| -2. Split the dataset into training and testing sets with `SKLearnTrainTestSplit`. |
58 |
| -3. Initialize the RandomForestClassifier model using `SKLearnRandomForestClassifier`. |
59 |
| -4. Train the model with `SKLearnModelTraining` using the training data. |
60 |
| -5. Evaluate the model's performance on the test set using `SKLearnClassificationEvaluation`. |
| 93 | +The SKLearn XAI Components Library offers a variety of components designed to facilitate every stage of the machine learning process. You are encouraged to explore these components and consult their documentation to enhance your understanding and application in building effective machine learning workflows. |
61 | 94 |
|
62 |
| -Refer to the component documentation for detailed usage instructions and parameter explanations. |
63 | 95 |
|
64 | 96 | ## Contributing
|
65 | 97 |
|
66 |
| -We welcome contributions to this library. If you have suggestions for new components or improvements to existing ones, please open an issue or submit a pull request. |
| 98 | +We welcome contributions to the **SKLearn XAI Components Library**! If you would like to contribute: |
| 99 | + |
| 100 | +1. Fork the repository. |
| 101 | +2. Create a new branch for your feature or bug fix. |
| 102 | +3. Open a pull request with a detailed description of your changes. |
| 103 | + |
| 104 | +Please feel free to suggest new components, improvements, or optimizations. If you encounter any issues or have ideas for enhancements, you can open an issue in the repository. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +### License |
| 109 | + |
| 110 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. |
| 111 | + |
0 commit comments