Recipe App

Last Updated on May 3, 2021

About

I have done the recipe project with django rest framework. First I have done the project using docker I have created a model like creating user and super user and then linked it in admin. After all I have written the test cases for the project more over I have created tags and ingredients which holds multiple data and after then I have created a auth_token so to generate the token first we have to create a user then it generates the token after that then we navigate to tags and ingredients to add data so this data gets add only if the user is authenticated after that we redirect to recipe page where we can add time, image, price and link etc

More Details: Recipe app

Submitted By


Share with someone who needs it

Machine Learning Implementation On Crop Health Monitoring System.

Last Updated on May 3, 2021

About

The objective of our study is to provide a solution for Smart Agriculture by monitoring the agricultural field which can assist the farmers in increasing productivity to a great extent. Weather forecast data obtained from IMD (Indian Metrological Department) such as temperature and rainfall and soil parameters repository gives insight into which crops are suitable to be cultivated in a particular area. Thus, the proposed system takes the location of the user as an input. From the location, the soil moisture is obtained. The processing part also take into consideration two more datasets i.e. one obtained from weather department, forecasting the weather expected in current year and the other data being static data. This static data is the crop production and data related to demands of various crops obtained from various government websites. The proposed system applies machine learning and prediction algorithm like Decision Tree, Naive Bayes and Random Forest to identify the pattern among data and then process it as per input conditions. This in turn will propose the best feasible crops according to given environmental conditions. Thus, this system will only require the location of the user and it will suggest number of profitable crops providing a choice directly to the farmer about which crop to cultivate. As past year production is also taken into account, the prediction will be more accurate.


More Details: MACHINE LEARNING IMPLEMENTATION ON CROP HEALTH MONITORING SYSTEM.

Submitted By


Wafer Sensors Faulty Detection

Last Updated on May 3, 2021

About

Project Description :

Detecting faulty sensors in wafers by using K means, Random forest, Decision tree algorithms


Problem Statement

To build a classification methodology to predict the quality of wafer sensors based on the given training data. 

Architecture

1.Data Description

2.Data validation

3.Data Insertion in Database

4.Model Training

5.Prediction Data Description

6.Data Validation

7.Data Insertion in Database

8.Prediction

9.Cloud Deployment

Data Description

The client will send data in multiple sets of files in batches at a given location. Data will contain Wafer names and 590 columns of different sensor values for each wafer. The last column will have the "Good/Bad" value for each wafer.

"Good/Bad" column will have two unique values +1 and -1. 

"+1" represents Bad wafer.

"-1" represents Good Wafer.

Apart from training files, we also require a "schema" file from the client, which contains all the relevant information about the training files such as:

Name of the files, Length of Date value in File Name, Length of Time value in File Name, Number of Columns, Name of the Columns, and their datatype.

Data Validation 

In this step, we perform different sets of validation on the given set of training files. 

a. Name Validation

b. Number of columns

c. Name of columns

d. Data type of columns

e. Null values in columns

If all the sets are as per requirement in schema file, we move such files to "Good_Data_Folder" else we move such files to "Bad_Data_Folder."

Data Insertion in Database

 1) Database Creation and connection -- Create a database with the given name passed.

2) Table creation in the database -- Table with name - "Good_Data", is created in the database for inserting the files in the "Good_Data_Folder" based on given column names and datatype in the schema file.

3) Insertion of files in the table -- All the files in the "Good_Data_Folder" are inserted in the above-created table. If any file has invalid data type in any of the columns, the file is not loaded in the table and is moved to "Bad_Data_Folder

Model Training

1) Data Export from Db - The data in a stored database is exported as a CSV file to be used for model training.

2) Data Preprocessing  

  a) Check for null values in the columns. If present, impute the null values using the KNN imputer.

  b) Check if any column has zero standard deviation, remove such columns as they don't give any information during model training.

3) Clustering --- KMeans algorithm is used to create clusters in the preprocessed data. The optimum number of clusters is selected by plotting the elbow plot, and for the dynamic selection of the number of clusters, we are using "KneeLocator" function. The idea behind clustering is to implement different algorithms

  To train data in different clusters. The Kmeans model is trained over preprocessed data and the model is saved for further use in prediction.

4) Model Selection --- After clusters are created, we find the best model for each cluster. We are using two algorithms, "Random Forest" and "XGBoost". For each cluster, both the algorithms are passed with the best parameters derived from GridSearch. We calculate the AUC scores for both models and select the model with the best score. Similarly, the model is selected for each cluster. All the models for every cluster are saved for use in prediction.

 Prediction Data Description


Client will send the data in multiple set of files in batches at a given location. Data will contain Wafer names and 590 columns of different sensor values for each wafer.

Apart from prediction files, we also require a "schema" file from client which contains all the relevant information about the training files such as:

Name of the files, Length of Date value in FileName, Length of Time value in FileName, Number of Columns, Name of the Columns and their datatype.


Then again we repeat steps 2,3

 Data Validation  

Data Insertion in Database 


Finally we go for


 Prediction

 

1) Data Export from Db - The data in the stored database is exported as a CSV file to be used for prediction.

2) Data Preprocessing   

  a) Check for null values in the columns. If present, impute the null values using the KNN imputer.

  b) Check if any column has zero standard deviation, remove such columns as we did in training.

3) Clustering - KMeans model created during training is loaded, and clusters for the preprocessed prediction data is predicted.

4) Prediction - Based on the cluster number, the respective model is loaded and is used to predict the data for that cluster.

5) Once the prediction is made for all the clusters, the predictions along with the Wafer names are saved in a CSV file at a given location and the location is returned to the client.



Deployment


We will be deploying the model to the Pivotal Cloud Foundry platform. Not only Pivotal but also we can use Heroku, AWS, Azure, GCP Platforms


Among the above all platforms Heroku is only a free open source platform for Deployment with unlimited storage.


Pivotal is a free open source before september 2020 ,Now it became a paid paltform


AWS, Azure, GCP these are all have free deployment source but with limited access


More Details: WAFER SENSORS FAULTY DETECTION

Python Snake Game

Last Updated on May 3, 2021

About

This game reminds everyone their childhood memories.

In this snake game, the player has to move the snake to the fruit in order to eat it. The score will increase once the fruit is eaten. Also, the length of the snake will increase if the snake eats the fruit. The game will get over if the snake touches itself.

The turtle and random modules are used in this game project. So as to install these libraries, simply type “pip install turtle” and “pip install random” on the command prompt.

Turtle library allows us to create pictures, diagrams in a virtual form whereas random module gives the value between the given range of it.

There are 3 functions defined in this game which is “change”, “inside function”, and “move” function. In change function, the x-axis and y-axis are defined. In inside function, the logic of the game is written and in the move function, movement to the snake is given.

There are 4 keys mentioned in the code “right, left, up, down”.

If the player presses the right key, the snake will move to right direction, If the player presses the left key , the snake will move to left direction, If the player presses the up key , the snake will move to upward direction, If the player presses the down key , the snake will move to downward direction and if the snake touches itself the game will get over.

More Details: Python Snake Game

Submitted By


Snake Game

Last Updated on May 3, 2021

About

The objective of this project is to build a snake game project using Python. In this python project, the player has to move a snake so it touches the red dot . If the snake touches itself or the border of the game then the game will over.

The following are the methods I used :

Turtle module, random module, time module, and concept of python by basically used in this project

Turtle module gives us a feature to draw on a drawing board

Random module will be used to generate random numbers

Time module is an inbuilt module in python. It provides the functionality of time.


The steps to build a snake game project in python:

The first is Importing libraries then we move to create a game screen and also the creation of snake and red dot. Keyboard binding is to be done next followed by the game main loop.


We require turtle, random, and time module to import

To create Game screen I used :-

  • title() :  will set the desired title of the screen
  • setup() : used to set the height and width of the screen
  • tracer(0) : will turn off the screen update
  • bgcolor()  : will set the background color
  • forward()  : will use to move the turtle in a forwarding direction for a specified amount
  • right() : used to turn the turtle clockwise and left() used to turn the turtle anticlockwise
  • penup() : will not draw while its move

For creating Game screen I used :-

  • Turtle() :  will be used to create a new turtle object
  • hideturtle() :  will use to hide the turtle
  • goto() :  used to move the turtle at x and y coordinates


Now by adding key binding in which the directions in which the snake will go and how will be decided.


If the snake touches the border of the game then the game will over. screen.clear() will delete all the drawing of the turtle on the screen



We successfully developed Snake game project in python.




More Details: Snake Game

Submitted By


Iris Flower Prediction

Last Updated on May 3, 2021

About

Understanding the scenario

Let’s assume that a hobby botanist is interested in distinguishing the species of some iris flowers that she has found. She has collected some measurements associated with each iris, which are:

  • the length and width of the petals
  • the length and width of the sepals, all measured in centimetres.

She also has the measurements of some irises that have been previously identified by an expert botanist as belonging to the species setosa, versicolor, or virginica. For these measurements, she can be certain of which species each iris belongs to. We will consider that these are the only species our botanist will encounter.

The goal is to create a machine learning model that can learn from the measurements of these irises whose species are already known, so that we can predict the species for the new irises that she has found.

Modules imported

  • SkLearn is a pack of Python modules built for data science applications (which includes machine learning). Here, we’ll be using three particular modules:
  • load_iris: The classic dataset for the iris classification problem. (NumPy array)
  • train_test_split: method for splitting our dataset.
  • KNeighborsClassifier: method for classifying using the K-Nearest Neighbor approach.
  • NumPy is a Python library that makes it easier to work with N-dimensional arrays and has a large collection of mathematical functions at its disposal. It’s’ base data type is the “numpy.ndarray”.

Building our model

As we have measurements for which we know the correct species of iris, this is a supervised learning problem. We want to predict one of several options (the species of iris), making it an example of a classification problem. The possible outputs (different species of irises) are called classes. Every iris in the dataset belongs to one of three classes considered in the model, so this problem is a three-class classification problem. The desired output for a single data point (an iris) is the species of the flower considering it’s features. For a particular data point, the class / species it belongs to is called its label.

As already stated, we will use the Iris Dataset already included in scikit-learn.

Now, let’s print some interesting data about our dataset:

ACCURACY we get an accuracy of 93%

OUTPUT IN THIS CASE    as we have 2 samples [[3,5,4,2], [2,3,5,4]]

so the iris type predicted by our model based on the given features are

predictions:  ['versicolor', 'virginica']

for more details this is my Github repository

ml-2/iris_flower.ipynb at main · THC1111/ml-2 (github.com)




More Details: Iris Flower Prediction

Submitted By