Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 2.2 KB

README.md

File metadata and controls

36 lines (26 loc) · 2.2 KB

Linear Regression Demo

This demo is a basic implementation of linear regression in Python using the Pandas, sklearn, Jupyter, and matplotlib libraries. It includes a Jupyter notebook that walks through the steps of loading and exploring a sample dataset, preparing the data for linear regression, and using sklearn to fit a linear regression model and make predictions. The notebook also includes visualizations of the data and the linear regression model.

Installation Guide

To run this demo in JupyterLab, you'll need to have Python 3 and the following libraries installed on your system:

  • Pandas
  • scikit-learn (sklearn)
  • JupyterLab
  • matplotlib

To avoid conflicts with other Python projects on your system, it's a good idea to create a virtual environment for this demo. Here's how to set up a virtual environment, activate it, and install the necessary libraries:

  1. Open a terminal or command prompt and navigate to the directory where you've cloned the demo repository.
  2. Create a virtual environment by running the following command: python3 -m venv env
  3. Activate the virtual environment by running the following command: source env/bin/activate (Note: On Windows, use env\Scripts\activate instead.)
  4. Install the necessary libraries by running the following command: pip install -r requirements.txt

Manually Install Libraries

Alternatively, you can install these packages manually using the following command:

pip install pandas scikit-learn jupyterlab matplotlib

It is not necessary to do this if you already ran pip install -r requirements.txt

Once you've installed the necessary libraries, you can start JupyterLab and load the demo notebook:

  1. Start JupyterLab by running the following command: jupyter lab
  2. In your web browser, navigate to http://localhost:8888/lab to access the JupyterLab interface.
  3. In the JupyterLab interface, navigate to the directory where you've cloned the demo repository.
  4. Click on the linear_regression_demo.ipynb file to load the demo notebook.

That's it! You should now be able to run the demo notebook and explore the implementation of linear regression while we code it live together in Python using Pandas, scikit-learn, JupyterLab, and matplotlib!