bearking58 commited on
Commit
469ec6b
·
1 Parent(s): f84359e

fix: 2nd model preprocess return df

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