Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
82 views
in Artificial Intelligence (AI) by (176k points)
What is feature engineering in machine learning?

Please log in or register to answer this question.

1 Answer

0 votes
by (176k points)

Feature engineering is the process of selecting, transforming, and creating relevant features from raw data to improve the performance of machine learning models. It involves techniques such as handling missing data, scaling features, encoding categorical variables, creating interaction terms, and more. Example code:

# Feature engineering example using pandas and scikit-learn
import pandas as pd
from sklearn.preprocessing import StandardScaler

# Load the dataset
data = pd.read_csv('data.csv')

# Drop irrelevant columns
data = data.drop(['id', 'date', 'zipcode'], axis=1)

# Handle missing data# Fill missing values with the mean
data['column_name'].fillna(data['column_name'].mean(), inplace=True)

# Scale numeric features
scaler = StandardScaler()
data['numeric_feature'] = scaler.fit_transform(data['numeric_feature'].values.reshape(-1, 1))

# Encode categorical variables
data = pd.get_dummies(data, columns=['categorical_variable'])

# Create interaction terms
data['interaction_term'] = data['feature1'] * data['feature2']
 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
3 answers
asked Jul 6, 2023 in Artificial Intelligence (AI) by kvdevika (176k points)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...