Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

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

Path Info

Clock icon Beginner
Clock icon 1h 0m
Clock icon Apr 05, 2019

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


    pip3 install pandas
  3. Challenge

    Review and run the program.

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

    The command to run the program is:

  4. Challenge

    Review and run the and programs.

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

    For predictcpu:

    For predictmem:

    To run the programs, the command is:



  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.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans