Sample Solution

Logistic Regression Model:
We will use the Python package Scikit-Learn for this model. The store data will be loaded into a pandas dataframe, and then converted to a numpy array in order to train the LogisticRegression model. We will predict whether stores will perform well or poorly based on features such as location type, size, age, customer count per month etc.

Steps:
1) Load the dataset using Pandas
2) Convert it to a Numpy array (X_train & Y_train) using .values() method
3) Split the dataset into training and testing datasets using Scikit-learn’s train_test_split function
4) Train the logistic regression model using Scikit-Learn’s LogisticRegression() class
5) Test and evaluate your trained models accuracy against the test dataset.

Decision Tree Model: We will use the Python package Scikit-Learn for this model as well. Similar steps can be followed from Step 1 to Step 4 of above Logistic Regression Problem with minor changes in step 2 ie we need to split our target variable ‘Store Performance’ from rest of variables before converting entire dataset into numpy array X & y respectively.

Steps:

1) Load the dataset using Pandas

2) Split Target Variable ‘Store Performance’ from Rest Variables of DataSet

3) Convert both target and non-target variables datasets into Numpy arrays (X & Y )using .values() method

4)Split both X and Y datasets into training and testing datasets using Scikit-learn’s train_test_split function

5 )Train Decision Tree Classifier Model by importing relevant library i.e sklearn tree library

6 )Test and evaluate your trained models accuracy against the test dataset via metrics like confusion matrix ,classification report etc..   Neural Network Model: We are going to use Keras(Python Library), which is an open source neural network library written in Python that uses TensorFlow/Theano underneath it for its backend calculations. This allows us to easily build complicated Neural Networks quickly without having any prior knowledge about Machine Learning algorithms or Neural Networks themselves! In addition, keras incorporates some very useful helper functions which simplify our code significantly when compared with writing out full implementations from scratch! Steps :
1)Load Dataset Using Pands or other packages
2)Data Preprocessing All numeric values should be scaled down between 0 – 1 range while nominal categorical values should one hot encoded so all attributes lie within same scale base range
3)Split Dataset Into Training Set And Test Set
4)-Construct The Architecture Of Our Network For This Problem Use A Multi Layer Perceptron (MLP). The MLP Can Be Constructed By Initializing An Object From Keras Sequential Class And Then Adding Several Dense Layers To It Next Can Compile Our Network With Appropriate Loss Function Optimizer And Evaluation Metrics Lastly Fit Your Train Data Into Your Generated MLP Classifier Object
5)-Prediction   Once You Have Trained Your MLP Model You Can Make Predictions About Each Store Performances By Feeding It Some Features Of That Particular Store Then Predict Whether That Store Will Perform Well Or Poorly Based On These Features

This question has been answered.

Get Answer
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
👋 WhatsApp Us Now