Machine Hack Problems
shreyashsomvanshi / machine-hack-practice-problems Goto Github PK
View Code? Open in Web Editor NEWMachine Hack Problems
Home Page: https://machinehack.com/user/63e66c416018ef32de78c4d0
License: MIT License
Machine Hack Problems
Home Page: https://machinehack.com/user/63e66c416018ef32de78c4d0
License: MIT License
Machine Hack Problems
_30. Rounding of float elements in a list.py
invalid results on MH
Arrays/#82. Difference between the mean and median of two sorted arrays
incorrect output .
Matrix/ 91. Add matrices.py is giving correct output for test cases but not getting accepted!
Try inbuilt method for median in statistics 160th @ShreyashSomvanshi
ML/462. Coefficients of the Logistic Regression model.py
'''
You are given a list of ground truth labels y_true_list and a list of predicted labels y_pred_list for multiple classes.
Write a function that takes these two lists as input and returns a pandas DataFrame containing evaluation metrics for each class.
The function should calculate the ROC AUC score, precision, and recall for each class. The input lists may contain multiple elements,
each corresponding to a different class. The function should return a DataFrame with one row per class and three columns containing the
evaluation metrics.
Example 1:
Input:
y_true_list = [[0, 1, 1, 0, 1],
[1, 1, 0, 0],
[0, 0, 1, 1, 0, 1]]
y_pred_list = [[0, 1, 0, 0, 1],
[1, 1, 1, 0],
[0, 0, 1, 0, 1, 1]]
Output:
ROC AUC Score Precision Recall
0 0.833333 0.866667 0.800000
1 0.750000 0.833333 0.750000
2 0.666667 0.666667 0.666667
Example 2:
Input:
y_true_list = [[1, 0, 0, 1, 1],
[0, 1, 0, 1],
[1, 1, 0, 0, 1, 0]]
y_pred_list = [[1, 0, 1, 1, 1],
[0, 1, 0, 0],
[1, 0, 0, 1, 1, 1]]
Output:
ROC AUC Score Precision Recall
0 0.75 0.850000 0.80
1 0.75 0.833333 0.75
2 0.50 0.500000 0.50
Constraints: The output should be in the pandas DataFrame.
'''
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.