Skip to main content

A example Python package

Project description

Explaining the main calss

In Machine Learning, there is an extended class of web applications that involve predicting user responses to options. Such an installation is called a recommender system.

Recommendation systems are widely used today to recommend products to users based on their interests. A recommendation system is one of the strongest systems for increasing profits by retaining more users in a very big competition. In the previous examples i showed u how to build system Recommendation for multiple type of file (CSV , Json , MongoDB , SalAlchemy) and using different module (TFIDF and KNN) using only one class(wraper) that can fit to all this type of files and modules

The Recommendation system class

The class SysRecommenadtion take only the Dataset as a parameter SysRecommenadtion(dataset_name) and different methode such as:

The Build methode:

build(model , SysRecMethode)

  • The model which it is the model for recommendation we have built

  • and the SysRecMethode its the type of algorithme we chouse (TFIDF or KNN) and if not chousen it will take the KNN algorithme as a default value

So now if the KNN algorithme is chousen the methode features is gona be required so it can fit with the model using the KNN algorithme it will make the build and get a list of the cousine simliarities which is gona be use in the prediction of the Recommendation system

And now if the TFIDF algorithme is been used nothing is recuired but the model which is gona be the TFIDF matrix using the TfidfVectorizer and the tfidf.fit_transform to build and get a list of the cousine simliarities which is gona be use in the prediction of the Recommendation system

The Prediction methode:

When this function is called, we will have to pass the value (Movie title , restaurent name ....) to it. The model will try to find results based on the features. We’ll store those results that the system recommends in a list and return them at the end:

predict(value, key, keys)

  • The predict methode is gonna return a list of Recommendation based on the value given (Movie title , restaurent name ....) and the key is the column name you wan to show (the title or the name for example) and if u wan to show multiple column at one use the keys parameter and give it a list of the column to show
  • predict(value='Spice Elephant' ,keys=['cuisines','Mean Rating', 'cost'])

First of all the key or the keys must be provided so it can do the prediction and get the list of Recommendation and then we hae two choices:

  • Using the KNN algorithme: We use the KNN algorithm to build our Recommendation system with Machine Learning using Python by getting the id from the source which have the same id's as the value given and return the list of results based on the value given

  • Using the TFIDF algorithme: We use the TFIDF algorithm to build our Recommendation system with Machine Learning using Python using the indice of the value given to get the similiaries result based on the value given by using the cosins similiarities and return the list of recomendation

  • note:

    The indices methode must be provided for the TFIDF algorithme so its can do the predection and get the result list

    Use The threshold methode to provide the number of the results u wan to show

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prediction_sys-0.0.5.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file prediction_sys-0.0.5.tar.gz.

File metadata

  • Download URL: prediction_sys-0.0.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for prediction_sys-0.0.5.tar.gz
Algorithm Hash digest
SHA256 2c50312ac9cb457596175c5321749161b2a0c48d2ee81e28101cc0f3254a4475
MD5 3524a1108e30436185ecdfa72f459cc3
BLAKE2b-256 73aa7551cb23fedfd76ea840558fe28bed257d61d4aab9cf567c9617337967b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page