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
76 views
in Artificial Intelligence (AI) by (176k points)
What is supervised learning?

Please log in or register to answer this question.

1 Answer

0 votes
by (176k points)

Supervised learning is a machine learning approach in which a model learns from labeled training data to make predictions or decisions on unseen data. In supervised learning, the algorithm is presented with input features and corresponding target labels, and it learns the mapping between the inputs and outputs. Examples of supervised learning algorithms include linear regression, decision trees, and support vector machines. Here's an example of training a decision tree classifier using scikit-learn:

from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier

# Load the dataset
iris = datasets.load_iris()
X = iris.data
y = iris.target

# Split the dataset into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Initialize the model
model = DecisionTreeClassifier()

# Train the model
model.fit(X_train, y_train)

# Make predictions on the test set
y_pred = model.predict(X_test)

Related questions

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

...