Skip to content

A simple prediction of sales using SVM(Support vector machine)

Notifications You must be signed in to change notification settings

sigmaharsh/salespredictionmodel-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sales prediction using svm model

Using support vector machine (SVM) i have created this simple prediction of sales project which uses the linear kernel can be used to predict sales for an organisation. I have picked a random dataset from internet and trained this model

Since i am using python i have used several libraries here:

  • pandas
  • sklearn
  • matplotlib.pyplot
  • streamlit

Streamlit App Setup Guide

This guide explains how to activate a Python virtual environment and run a Streamlit app on Linux or macOS. Note: These instructions may not work on Windows.

Prerequisites

  • Python 3.6 or higher installed
  • pip (Python package installer)

Steps to Setup and Run

1. Create a Virtual Environment

Open a terminal in your project directory and run:

python3 -m venv prediction

move the svm.py and the .csv file into virtual enviornment folder named "prediction"

cp svm.py ~/path/to/the/predictionfolder
cp sales_data_past_2_years.csv  ~/path/to/the/predictionfolder

2. Activate the Virtual Environment

source prediction/bin/activate

After activation, your terminal prompt should display (prediction).

3. Install Streamlit

With the virtual environment activated, install Streamlit:

pip install streamlit

4. Run the Streamlit App

Navigate to the directory containing svm.py and run:

streamlit run svm.py

5. Stop the Streamlit App

To stop the app, press CTRL + C in the terminal.

6. Deactivate the Virtual Environment

When done, deactivate the virtual environment with:

deactivate

Warning for Windows Users

The above instructions are optimized for Linux and macOS. On Windows, commands may differ, and additional setup may be required.

Troubleshooting

  • Command not found: Ensure Python and pip are installed and available in your system's PATH.
  • Verify Streamlit installation with pip list inside the virtual environment.

the streamlit app now should run on your localhost port 8501

About

A simple prediction of sales using SVM(Support vector machine)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages