Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Using Python ML for Predictive Analytics

This lab guides the student through Python examples that utilize metrics gathered from Prometheus. The Python Sci-Learn library is used for a Linear Regression example.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Sep 22, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install pip3.

    The command to install pip3 is:

    sudo apt install python3-pip
    
  2. Challenge

    Install Sci-Kit and Pandas Python modules.

    Use the pip3 command to install Sci-Kit Learn:

    pip3 install scikit-learn
    

    And:

    pip3 install pandas
    
  3. Challenge

    Review and run the check.py program.

    To review the code, you can navigate to the GitHub repository and view the check.py file. The link is:

    https://github.com/linuxacademy/content-aiops-essentials/blob/master/check.py
    

    The command to run the program is:

    python3 check.py
    
  4. Challenge

    Review and run the predictcpu.py and predictmem.py programs.

    To review the programs, you may use the following links:

    For predictcpu:

    https://github.com/linuxacademy/content-aiops-essentials/blob/master/predictcpu.py
    

    For predictmem:

    https://github.com/linuxacademy/content-aiops-essentials/blob/master/predictmem.py
    

    To run the programs, the command is:

    python3 predictcpu.py
    

    And:

    python3 predictmem.py
    
  5. Challenge

    Change the number of replicas to project.

    To change the number of replicas to project, edit the following file:

    [vi or nano] promql2.csv
    

    And then change the data column for replicas to the values you want to project.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight