← 返回 bytedance 的题目列表Logistic Regression
类型:online_judge
Program a simple logistic regression class with train() and predict() methods using just NumPy. Derive the logistic regression loss function using sigmoid derivatives to get the binary cross-entropy loss.
Input:
Training dataset containing features and labels.
Output:
Parameters of the logistic regression model.
Predictions on new data.
Example Test Cases: Training set: Features: [[1, 2], [3, 4], [5, 6], [7, 8]] Labels: [0, 0, 1, 1] Prediction data: [[2, 3], [8, 9]]
Data scale:
Feature count up to 1000.
Data point count up to 10000.
Example
Input
Features: [[1, 2], [3, 4], [5, 6], [7, 8]], Labels: [0, 0, 1, 1], Predict: [[2, 3], [8, 9]]