Yes or No
Each row of X describes one applicant and y says whether they were accepted (1) or not (0). Fit a logistic regression with its default settings and return its predictions for the rows of X_new.
Example 1
X [[1],[2],[3],[4],[5],[6],[7],[8],[9],[10]]
y [0,0,0,0,1,0,1,1,1,1]
X_new [[0],[12],[2]]
returns [0,1,0]
Low numbers were mostly refused and high numbers mostly accepted, and the model draws its line in between.
Constraints
10 <= len(X) <= 50, both labels present1 <= len(X_new) <= 8- No new row is a close call
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More scikit-learn problems
- Average Over Five FoldsMedium
- Best Number of NeighborsMedium
- Centers of the GroupsMedium
- Column That Matters MostMedium
- How Well It RanksMedium
- No PeekingMedium
- Scale Then VoteMedium
- Shrunken SlopesMedium