top of page

Predict The Daily Number of Units Sold of Different Products

DESCRIPTION

Dataset Used: PredictionsFor4April2019.csv

Problem Statement: ABC Company has made a model to predict the daily number of units sold of different products


Import Necessary Packages

import pandas as pd

Read Dataset

df = pd.read_csv("PredictionsFor4April2019.csv")
df.head()

Output:








df['error'] = ((df.PredValue - df.ActualValue) ** 2)
df.head()

Output:








RMSE for Country DE

rmse_DE = df[df.Country_code == 'DE']['error'].mean() ** .5
rmse_DE_round = round(rmse_DE,1)
rmse_DE_round

output:

10.9

RMSE for Country AT

rmse_AT = df[df.Country_code == 'AT']['error'].mean() ** .5
rmse_AT_round = round(rmse_AT,1)
rmse_AT_round

Output:

0.6

RMSE for Country PL

rmse_PL = df[df.Country_code == 'PL']['error'].mean() ** .5
rmse_PL_round = round(rmse_PL,1)
rmse_PL_round

Output:

1.3

Writing into the list

list_of_result_values = []
list_of_result_values.append(rmse_DE_round)
list_of_result_values.append(rmse_AT_round)
list_of_result_values.append(rmse_PL_round)
list_of_result_values

Output:

[10.9, 0.6, 1.3]

Save Output Into csv file

file = open('./output/output.csv','a+')
file.write("Question2 Output" +"\n")
file.write(str(list_of_result_values) +"\n")
file.close()



If you need any other Data Science related help then send your requirement details at:

If you have any doubt related to above code then also comment in below comment section or send me your suggestion regarding this.

REALCODE4YOU

Realcode4you is the one of the best website where you can get all computer science and mathematics related help, we are offering python project help, java project help, Machine learning project help, and other programming language help i.e., C, C++, Data Structure, PHP, ReactJs, NodeJs, React Native and also providing all databases related help.

Hire Us to get Instant help from realcode4you expert with an affordable price.

USEFUL LINKS

Discount

ADDRESS

Noida, Sector 63, India 201301

Follows Us!

  • Facebook
  • Twitter
  • Instagram
  • LinkedIn

OUR CLIENTS BELONGS TO

  • india
  • australia
  • canada
  • hong-kong
  • ireland
  • jordan
  • malaysia
  • new-zealand
  • oman
  • qatar
  • saudi-arabia
  • singapore
  • south-africa
  • uae
  • uk
  • usa

© 2023 IT Services provided by Realcode4you.com

bottom of page