Redve commited on
Commit
59ed707
·
1 Parent(s): 14eadb2

Added std

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -19,9 +19,9 @@ print("Model downloaded")
19
  def wine_quality(type, fixed_acidity, volatile_acidity, citric_acid, residual_sugar, chlorides, free_sulfur_dioxide, total_sulfur_dioxide, density, pH, sulphates, alcohol):
20
  print("Calling function")
21
  if(type == "red"):
22
- type = -1.750190
23
  else:
24
- type = 0.571367
25
  fixed_acidity = float(fixed_acidity)
26
  volatile_acidity = float(volatile_acidity)
27
  citric_acid = float(citric_acid)
@@ -45,6 +45,9 @@ def wine_quality(type, fixed_acidity, volatile_acidity, citric_acid, residual_su
45
  df['cv'] = df.std(axis = 1, skipna = True)/df.mean(axis = 1, skipna = True)
46
  df['range'] = df.max(axis = 1, skipna = True) - df.min(axis = 1, skipna = True)
47
  df['iqr'] = df.quantile(q=0.75, axis=1) - df.quantile(q=0.25, axis=1)
 
 
 
48
  print("Predicting")
49
  print(df)
50
  # 'res' is a list of predictions returned as the label.
 
19
  def wine_quality(type, fixed_acidity, volatile_acidity, citric_acid, residual_sugar, chlorides, free_sulfur_dioxide, total_sulfur_dioxide, density, pH, sulphates, alcohol):
20
  print("Calling function")
21
  if(type == "red"):
22
+ type = 0
23
  else:
24
+ type = 1
25
  fixed_acidity = float(fixed_acidity)
26
  volatile_acidity = float(volatile_acidity)
27
  citric_acid = float(citric_acid)
 
45
  df['cv'] = df.std(axis = 1, skipna = True)/df.mean(axis = 1, skipna = True)
46
  df['range'] = df.max(axis = 1, skipna = True) - df.min(axis = 1, skipna = True)
47
  df['iqr'] = df.quantile(q=0.75, axis=1) - df.quantile(q=0.25, axis=1)
48
+ std = [1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,0.87318806,13.61936699,1.06523663,2.20015409,0.90773674,0.34930211,157.68206107,36.25486258,0.89928889,164.96305981,0.8129753]
49
+ mean = [1.04990153e-16,5.94944202e-16,-1.04990153e-16,3.67465537e-16,0.00000000e+00,-1.04990153e-16,-8.74917945e-17,0.00000000e+00,-3.56091603e-15,1.83732768e-15,-2.79973742e-16,-8.39921227e-16,5.81837771e+00,4.74279410e-01,2.02605923e+00,4.83126758e+00,8.21873995e-01,3.66500453e-01,1.42755219e+01,4.44186247e+00,2.16897663e+00,1.86896805e+01,2.38335738e+00]
50
+ df = (df-mean)/std
51
  print("Predicting")
52
  print(df)
53
  # 'res' is a list of predictions returned as the label.