Spaces:
Sleeping
Sleeping
Update course_recommender.py
Browse files26 unmodified lines272829303132310 unmodified lines34334434534626 unmodified lines"""Preprocess the data for training"""df_processed = df.copy()# Encode categorical variablescategorical_columns = ['strand', 'hobbies']310 unmodified linesdef add_feedback(self, course: str, stanine: int, gwa: float, strand: str,rating: int, hobbies: str) -> bool:"""Add user feedback to the database"""return self.db_connection.add_feedback(course, stanine, gwa, strand, rating, hobbies)26 unmodified lines27282930313233343536310 unmodified lines34734834935026 unmodified lines"""Preprocess the data for training"""df_processed = df.copy()# Normalize strand to uppercase for case-insensitive matchingif 'strand' in df_processed.columns:df_processed['strand'] = df_processed['strand'].astype(str).str.upper()# Encode categorical variablescategorical_columns = ['strand', 'hobbies']310 unmodified linesdef add_feedback(self, course: str, stanine: int, gwa: float, strand: str,rating: int, hobbies: str) -> bool:"""Add user feedback to the database"""return self.db_connection.add_feedback(course, stanine, gwa, strand, rating, hobbies)
course_recommender.py+5-1