Creating personalised learning paths with AI

Use AI to generate tailored learning experiences that adapt to student's unique needs and preferences.

Tags Streamline Icon:
Wrench Streamline Icon:
People Man Graduate Streamline Icon:

In this tutorial, we'll walk through the process of using AI to create personalised learning paths for students. By following these steps, you'll be able to generate tailored learning experiences that adapt to each student's unique needs and preferences.

This is an advanced tutorial that uses code. To complete all steps, you’ll need:

  • To be able to survey your students using a form, e.g. Google Forms or SurveyMonkey, to identify their preferred learning style
  • An LMS
  • Access to Google Analytics, and the ability to connect it to your LMS
  • Knowledge of Google Sheets
  • Knowledge of Python

Steps we’ll walk through in this tutorial:

  • Gather your student data
  • Prepare (clean, transform and split) your data
  • Train a decision tree classifier
  • Generate personalised learning experiences for students
Products Give Gift 1 Streamline Icon:

Try before you bite?
This one's on us.

Sign up for a free account to view our free courses

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Step 1: Collecting student data

To create personalised learning paths, you first need to gather relevant information about your students. This data will serve as the foundation for training your AI model.

Develop surveys and assessments

  • Create a learning style survey using the VARK (Visual, Auditory, Reading/Writing, Kinesthetic) model to identify each student's preferred learning style. You can use a tool like Google Forms or SurveyMonkey to create and distribute the survey. The survey should ask students to answer questions that help determine their preferred learning style.
  • Design a multiple-choice assessment to evaluate students' knowledge and skills in a specific subject area (e.g., mathematics). You can create this assessment using a tool like Google Forms or a built-in assessment feature in your LMS. Make sure to include questions that cover the key topics and skills you want to assess.

Implement learning analytics

  • Sign up for a Google Analytics account at if you don't already have one.
  • Follow the instructions provided by Google Analytics to set up tracking for your LMS. This typically involves adding a tracking code to your LMS's pages.
  • Configure Google Analytics to track relevant student engagement and performance metrics, such as time spent on tasks, completion rates, and quiz scores.

Organise and store data

  • Export the data from your learning style survey, assessment, and Google Analytics into separate CSV files. A CSV (Comma-Separated Values) file is a plain text file that stores data in a table format, with each column separated by a comma.
  • Create a new CSV file that combines the data from the separate files. Use a spreadsheet tool like Google Sheets to create a table with columns for student ID, learning style, assessment scores, engagement metrics, and performance metrics.
  • Save the combined data as a new CSV file (e.g., "student_data.csv").

Step 2: Preprocessing data

Before training your AI model, you need to clean and prepare the collected student data to ensure optimal performance.

Clean the data

  • In your "student_data.csv" spreadsheet, remove any rows that have missing values or incomplete data. This ensures that your dataset is consistent and complete.
  • Save the cleaned data as a new CSV file (e.g., "cleaned_student_data.csv").

Transform the data

  • In your "cleaned_student_data.csv" file - for the learning style column, create four new columns: Visual, Auditory, Reading/Writing, and Kinesthetic. Fill these columns with binary values (1 or 0) based on the student's learning style. For example, if a student's learning style is Visual, put a 1 in the Visual column and 0s in the other three columns. This process is called one-hot encoding and helps the AI model understand categorical data.
  • For the assessment scores and engagement metrics columns, normalise the values to a scale of 0 to 1. To do this, find the maximum value in each column, then divide each value in the column by the maximum. This step ensures that all features have a similar scale, which improves the AI model's performance.
  • Save the transformed data as a new CSV file (e.g., "transformed_student_data.csv").

Split the data

  • The next steps involve using Python and scikit-learn library. If you don't have Python installed, download and install it from Then, install the scikit-learn library by opening a command prompt or terminal and running the command: pip install scikit-learn.
  • Open a new Python file in a text editor or an integrated development environment (IDE) like PyCharm or Visual Studio Code.
  • First, import the necessary libraries:
import pandas as pd
from sklearn.model_selection import train_test_split

Load the "transformed_student_data.csv" file into a pandas DataFrame:

data = pd.read_csv("transformed_student_data.csv")

Separate the features (learning style, assessment scores, and engagement metrics) and the target variable (performance metrics):

features = data[["Visual", "Auditory", "Reading/Writing", "Kinesthetic", "Assessment_Score", "Engagement_Metric"]]
target = data["Performance_Metric"]

Use the train_test_split function to split the data into training and testing sets:

train_features, test_features, train_target, test_target = train_test_split(features, target, test_size=0.2, random_state=42)

This code splits the data into training and testing sets, with 80% of the data used for training and 20% for testing. The random_state parameter ensures that the split is reproducible.

Step 3: Training the AI model

With the preprocessed data ready, you can now train a decision tree classifier to identify patterns and insights in student learning.

Import necessary libraries

In the same Python file, import the DecisionTreeClassifier:

from sklearn.tree import DecisionTreeClassifier

Train the model

Create an instance of the DecisionTreeClassifier with a max_depth of 5:

classifier = DecisionTreeClassifier(max_depth=5)

Setting max_depth to 5 helps prevent overfitting by limiting the depth of the decision tree.

Fit the classifier to the training data:, train_target)

This step trains the decision tree classifier using the training features and target variable.

Evaluate the model

Use the trained classifier to predict the performance metrics for the testing set:

predictions = classifier.predict(test_features)

Calculate the accuracy score:

from sklearn.metrics import accuracy_score
accuracy = accuracy_score(test_target, predictions)
print(f"Accuracy: {accuracy:.2f}")

This code calculates the accuracy score by comparing the predicted performance metrics with the actual values from the testing set. The accuracy score represents the proportion of correct predictions made by the model.

Step 4: Generating personalised learning paths

With the trained decision tree classifier, you can now generate personalised learning paths for each student.

Define learning path templates

Create a dictionary of learning path templates for each combination of learning style and performance level. For example:

learning_paths = {
"Visual-High": {
"content_types": ["Videos", "Infographics"],        "activities": ["Projects", "Presentations"],        "assessments": ["Visual quizzes"]
"Auditory-Low": {
"content_types": ["Podcasts", "Audiobooks"],        "activities": ["Discussions", "Debates"],        "assessments": ["Oral exams"]
# Add more learning path templates for each combination

Customise the learning path templates based on your subject area and the types of content, activities, and assessments that align with each learning style and performance level.

Generate recommendations

Use the trained classifier to predict the performance level for each student in the testing set:

performance_levels = classifier.predict(test_features)

Create a function to retrieve the corresponding learning path template based on a student's learning style and predicted performance level:

def get_learning_path(learning_style, performance_level):
key = f"{learning_style}-{performance_level}"
return learning_paths.get(key, "No matching learning path found.")

Present learning paths

Generate personalised learning path reports for each student in the testing set:

for i in range(len(test_features)):
learning_style = test_features.iloc[i][["Visual", "Auditory", "Reading/Writing", "Kinesthetic"]].idxmax()    
performance_level = "High" if performance_levels[i] == 1 else "Low"    
learning_path = get_learning_path(learning_style, performance_level)
print(f"Student {i+1}:")
print(f"  Learning Style: {learning_style}")
print(f"  Performance Level: {performance_level}")
print(f"  Recommended Learning Path: {learning_path}")

This code iterates through each student in the testing set, identifies their dominant learning style and predicted performance level, retrieves the corresponding learning path template, and prints a personalised report.

You can modify this code to display the reports on a web page or export them as PDF files, depending on your preferred method of sharing the results with students.

Step 5: Implementing and monitoring

After generating the personalised learning paths, it's crucial to implement them effectively and monitor student progress.

  • Integrate with LMS: Manually assign the recommended content, activities, and assessments to each student within your LMS based on their personalised learning path report. This process will vary depending on the specific LMS you are using.
  • Monitor student progress: Use Google Analytics to continuously track student engagement and performance as they follow their personalised learning paths. Regularly review the data to identify trends and areas for improvement.
  • Gather feedback: Create a feedback survey using Google Forms or a similar tool to collect input from students and teachers on the effectiveness and usability of the personalised learning paths. Include questions that assess the relevance of the recommended content, activities, and assessments, as well as the overall impact on learning outcomes and engagement.
  • Iterate and improve: Annually update the decision tree classifier with new student data and feedback. Repeat the steps in this tutorial to preprocess the updated data, retrain the model, and generate revised personalised learning paths. Continuously refine the learning path templates based on student performance and feedback. Adjust the recommended content types, activities, and assessments to ensure they remain effective and relevant.

By following these detailed steps and explanations, you should be able to create personalised learning paths using AI, even as a beginner. Remember to customise the specific tools, templates, and recommendations based on your subject area and teaching context. With time and practice, you'll become more comfortable with the process and can explore more advanced techniques to further enhance the personalised learning experiences for your students.

Get full access

✔️ All 100+ courses & tutorials in our catalog
✔️ New content added weekly
✔️ Private community access
✔️ No subscription, $150 paid once
✔️ Expense it using this template. Or get a team account.
✔️ 30-day refund policy. No questions asked
Join 3,107 learners from companies like Microsoft, Coca Cola, NBA, Adobe & Google

More tutorials like this

View all

If you scrolled this far, you must be a little interested...

Start learning ->

Join 3,107 professionals already learning