bearking58 commited on
Commit
09418f5
·
1 Parent(s): 04383e2

fix: numpy to dataframe

Browse files
core-model-prediction/random_forest_model.py CHANGED
@@ -15,7 +15,8 @@ class RandomForestModel:
15
  def preprocess_input(self, secondary_model_features: List[float]) -> np.ndarray:
16
  features_df = pd.DataFrame([secondary_model_features], columns=[
17
  self.secondary_model_features])
18
- features_df = self.scaler.transform(features_df)
 
19
  return features_df.values.astype(np.float32).reshape(1, -1)
20
 
21
  def predict(self, secondary_model_features: List[float]):
 
15
  def preprocess_input(self, secondary_model_features: List[float]) -> np.ndarray:
16
  features_df = pd.DataFrame([secondary_model_features], columns=[
17
  self.secondary_model_features])
18
+ features_df[self.secondary_model_features] = self.scaler.transform(
19
+ features_df[self.secondary_model_features])
20
  return features_df.values.astype(np.float32).reshape(1, -1)
21
 
22
  def predict(self, secondary_model_features: List[float]):