Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions docs/14_machine_learning_basics/arfpy_lesson.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 2 additions & 1 deletion docs/14_machine_learning_basics/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
plaintext
jupyter-book<2.0.0
sphinx-book-theme<1.0.0
matplotlib
numpy
arfpy