diff --git a/docs/14_machine_learning_basics/arfpy_lesson.ipynb b/docs/14_machine_learning_basics/arfpy_lesson.ipynb new file mode 100644 index 000000000..e849025ac --- /dev/null +++ b/docs/14_machine_learning_basics/arfpy_lesson.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# ARFPy Lesson\n", + "\n", + "Welcome to this ARFPy demonstration. In this lesson, we'll walk through some basics of using the `arfpy` library for machine learning tasks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Ensure arfpy is installed\n", + "!pip install arfpy" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Introduction to ARFPy\n", + "\n", + "`arfpy` is a powerful library used to perform automated machine learning tasks with minimal code. It provides various tools and functionalities to train, validate, and deploy machine learning models efficiently." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: Training a simple model using ARFPy\n", + "\n", + "Let's look at a quick example on how to use `arfpy` to train a machine learning model." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import arfpy as arp\n", + "from sklearn.datasets import load_iris\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn.metrics import accuracy_score\n", + "\n", + "# Load iris dataset from sklearn\n", + "data = load_iris()\n", + "X, y = data.data, data.target\n", + "\n", + "# Split the data into training and testing sets\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)\n", + "\n", + "# Initialize an ARFPy model\n", + "model = arp.Model()\n", + "\n", + "# Train the model\n", + "model.fit(X_train, y_train)\n", + "\n", + "# Make predictions\n", + "y_pred = model.predict(X_test)\n", + "\n", + "# Evaluate the model\n", + "accuracy = accuracy_score(y_test, y_pred)\n", + "print(f'Model accuracy: {accuracy * 100:.2f}%')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/14_machine_learning_basics/readme.md b/docs/14_machine_learning_basics/readme.md index 6ae7638f4..a01af6783 100644 --- a/docs/14_machine_learning_basics/readme.md +++ b/docs/14_machine_learning_basics/readme.md @@ -5,7 +5,8 @@ In this chapter we will introduce the basics of classical machine learning. We w To get a wider perspective on available algorithms and methods, the reader is referred to the [scikit-learn documentation](https://scikit-learn.org/stable/supervised_learning.html#supervised-learning) and [Digital Sreeni's YouTube channel](https://www.youtube.com/c/DigitalSreeni). ## Python libraries used in this chapter -We will use [scikit-learn](https://scikit-learn.org/) which can be installed like this: +We will use [scikit-learn](https://scikit-learn.org/) and [arfpy](https://pypi.org/project/arfpy/) which can be installed like this: ``` mamba install scikit-learn +pip install arfpy ``` diff --git a/requirements.txt b/requirements.txt index 297915fd5..d7c7a2d63 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ +plaintext jupyter-book<2.0.0 sphinx-book-theme<1.0.0 matplotlib numpy +arfpy