mlquiz 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mlquiz/__init__.py +0 -0
- mlquiz/cards.csv +54 -0
- mlquiz/main.py +108 -0
- mlquiz-0.1.0.dist-info/METADATA +6 -0
- mlquiz-0.1.0.dist-info/RECORD +8 -0
- mlquiz-0.1.0.dist-info/WHEEL +5 -0
- mlquiz-0.1.0.dist-info/entry_points.txt +2 -0
- mlquiz-0.1.0.dist-info/top_level.txt +1 -0
mlquiz/__init__.py
ADDED
|
File without changes
|
mlquiz/cards.csv
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
category,type,question,correctanswer,optiona,optionb,optionc,optiond
|
|
2
|
+
basics,mcq,what does ai stand for?,artificial intelligence,artificial intelligence,automated information,advanced integration,algorithmic input
|
|
3
|
+
basics,fill,what type of ai exists today? (narrow or general),narrow,,,,
|
|
4
|
+
basics,mcq,what is the term for ai that surpasses human intelligence in every domain?,asi,agi,narrow ai,asi,machine learning
|
|
5
|
+
basics,mcq,what is the first step of the ai development pipeline?,collect data,deploy,train model,collect data,validate
|
|
6
|
+
basics,mcq,which year did the deep learning revolution start with alexnet?,2012,2012,2005,2018,1997
|
|
7
|
+
basics,mcq,what is the process of adjusting model parameters to minimize error called?,training,testing,deploying,validating,training
|
|
8
|
+
basics,fill,what does agi stand for?,artificial general intelligence,,,,
|
|
9
|
+
ethics,mcq,what amplifies bias in an ai system?,data,the algorithm,the hardware,data,the user
|
|
10
|
+
ethics,fill,what is the term for when biased ai decisions create biased future data?,feedback loop,,,,
|
|
11
|
+
ethics,mcq,which fairness definition requires equal positive prediction rates across groups?,demographic parity,demographic parity,equalized odds,calibration,individual fairness
|
|
12
|
+
ethics,mcq,is it mathematically possible to satisfy demographic parity and equalized odds at the same time if base rates differ?,no,yes,only with deep learning,only with small data,no
|
|
13
|
+
ethics,mcq,adding calibrated noise to data to protect privacy is called what?,differential privacy,data masking,anonymization,differential privacy,encryption
|
|
14
|
+
ethics,fill,what type of models are least interpretable but often most accurate?,deep neural networks,,,,
|
|
15
|
+
ethics,mcq,what is it called when an ai system makes a wrong prediction that reinforces negative stereotypes?,feedback loop,feedback loop,distribution shift,data leakage,bias mitigation
|
|
16
|
+
data,mcq,what scaling method transforms data to have a mean of 0 and a standard deviation of 1?,standard scaling,min-max scaling,pca scaling,log scaling,standard scaling
|
|
17
|
+
data,mcq,using readmission date to predict hospital readmission is an example of what?,target leakage,feature leakage,target leakage,concept drift,survivorship bias
|
|
18
|
+
data,fill,what type of shift occurs when the relationship between inputs and outputs changes over time?,concept drift,,,,
|
|
19
|
+
data,mcq,a dataset of only successful startups is an example of what?,survivorship bias,survivorship bias,selection bias,non-response bias,convenience sampling
|
|
20
|
+
data,mcq,converting categorical variables like color into binary columns is called what?,one-hot encoding,label encoding,scaling,binning,one-hot encoding
|
|
21
|
+
data,fill,what split is used for tuning hyperparameters?,validation,,,,
|
|
22
|
+
data,mcq,what type of leakage occurs when test data statistics influence training preprocessing?,feature leakage,target leakage,feature leakage,concept drift,label shift
|
|
23
|
+
data,mcq,a spam filter trained on 5% spam deployed when spam is 40% is an example of what?,label shift,covariate shift,label shift,concept drift,feature leakage
|
|
24
|
+
supervised,mcq,what type of supervised learning predicts continuous values?,regression,classification,clustering,regression,generative
|
|
25
|
+
supervised,fill,what function maps any real number to a value between 0 and 1?,sigmoid,,,,
|
|
26
|
+
supervised,mcq,which regularization method tends to make some parameters exactly zero?,l1 regularization,l2 regularization,dropout,l1 regularization,early stopping
|
|
27
|
+
supervised,mcq,what algorithm finds the hyperplane that maximizes the margin between classes?,support vector machine,support vector machine,decision tree,logistic regression,naive bayes
|
|
28
|
+
supervised,fill,what does svm stand for?,support vector machine,,,,
|
|
29
|
+
supervised,mcq,what is the loss function used for linear regression called?,mean squared error,mean absolute error,cross entropy,mean squared error,hinge loss
|
|
30
|
+
supervised,fill,what is the maximum margin classifier also known as? (abbreviation),svm,,,,
|
|
31
|
+
supervised,mcq,which algorithm uses entropy and information gain to split data?,decision tree,linear regression,svm,naive bayes,decision tree
|
|
32
|
+
supervised,fill,what is the name of the algorithm used to train neural networks by calculating gradients backwards?,backpropagation,,,,
|
|
33
|
+
supervised,mcq,what happens when a model is too complex and memorizes training data?,overfitting,overfitting,underfitting,regularization,bias
|
|
34
|
+
supervised,fill,what is the probabilistic classifier based on bayes theorem called?,naive bayes,,,,
|
|
35
|
+
basics,mcq,what subfield of ai focuses on processing images?,computer vision,natural language processing,computer vision,neural networks,robotics
|
|
36
|
+
basics,fill,what type of ai is a chess engine,narrow,,,,
|
|
37
|
+
basics,mcq,what does the term deep in deep learning refer to?,many layers,many layers,complex math,big data,fast gpus
|
|
38
|
+
ethics,fill,what is the trade off called when a model is highly accurate but hard to explain?,interpretability,,,,
|
|
39
|
+
data,mcq,what is the usual train test split ratio?,70-15-15,50-25-25,80-10-10,100-0-0,70-15-15
|
|
40
|
+
data,fill,what typeof shift occurs when the input distribution changes but the relationship stays the same?,covariate shift,,,,
|
|
41
|
+
supervised,mcq,what is the main goal of gradient descent?,minimize the loss function,minimize the loss function,maximize the score,increase variance,reduce features
|
|
42
|
+
supervised,fill,what is the term for a model that is too simple and can't capure the pattern in the data itself?,underfitting,,,,
|
|
43
|
+
supervised,mcq,which algorithm combines multiple desicion trees?,random forest,logistic regression,vector machines,random forest,naive bayes
|
|
44
|
+
supervised,fill,what is the name of the parameter that controls the step size in gradient descent?,learning rate,,,,
|
|
45
|
+
supervised,fill,what is the term for the penalty added to a loss function to prevent overfitting?,regularization,,,,
|
|
46
|
+
supervised,fill,what type of loss function does svm use?,hinge loss,,,,
|
|
47
|
+
evaluation,mcq,what is the mean of precision and recall called?,f1 score,accuracy,f1 score,auc,mean squared error
|
|
48
|
+
evaluation,fill,what metric measures the fraction of actual positives that were correctly identified?,recall,,,,
|
|
49
|
+
evaluation,mcq,what is it called when a model performs well on training data but not on test data?,overfitting,overfitting,underfitting,bias,variance
|
|
50
|
+
evaluation,mcq,what does high bias indicate about a model?,underfitting,overfitting,underfitting,high variance,data leakage
|
|
51
|
+
evaluation,mcq,if the model is really unbalanced which metric is misleading?,accuracy,recall,presicion,accuracy,f1 score
|
|
52
|
+
kernels,mcq,what allows models to work in high dimensional space without computing the coordinates?,kernel trick,kernel trick,gradient descent,feature scaling,overfitting
|
|
53
|
+
kernels,fill,what kernel is also known as the rbf kernel?,Gaussian,,,,
|
|
54
|
+
kernels,mcq,which property must a kernel matrix satisfy to be valid?,symmetric,diagonal,orthogonal,symmetric,equal
|
mlquiz/main.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
def clear():
|
|
5
|
+
os.system('cls' if os.name =='nt' else 'clear')
|
|
6
|
+
|
|
7
|
+
def run_quiz(df):
|
|
8
|
+
clear()
|
|
9
|
+
#df = pd.read_csv(filename)
|
|
10
|
+
score = 0
|
|
11
|
+
wrong = []
|
|
12
|
+
|
|
13
|
+
for index, row in df.iterrows():
|
|
14
|
+
print(f"question {index+1} {row['question']}")
|
|
15
|
+
if row['type'] == 'mcq':
|
|
16
|
+
print(f"a) {row['optiona']}")
|
|
17
|
+
print(f"b) {row['optionb']}")
|
|
18
|
+
print(f"c) {row['optionc']}")
|
|
19
|
+
print(f"d) {row['optiond']}")
|
|
20
|
+
|
|
21
|
+
answer = input("\nyour answer ")
|
|
22
|
+
answer = answer.strip().lower()
|
|
23
|
+
|
|
24
|
+
if row['type'] == 'mcq':
|
|
25
|
+
if answer == 'a':
|
|
26
|
+
answer = str(row['optiona']).strip().lower()
|
|
27
|
+
elif answer == 'b':
|
|
28
|
+
answer = str(row['optionb']).strip().lower()
|
|
29
|
+
elif answer == 'c':
|
|
30
|
+
answer = str(row['optionc']).strip().lower()
|
|
31
|
+
elif answer == 'd':
|
|
32
|
+
answer = str(row['optiond']).strip().lower()
|
|
33
|
+
|
|
34
|
+
if answer == str(row['correctanswer']).strip().lower():
|
|
35
|
+
print("correct")
|
|
36
|
+
score += 1
|
|
37
|
+
else:
|
|
38
|
+
print(f"wrong answer, correct answer is {row['correctanswer']}")
|
|
39
|
+
wrong.append(row)
|
|
40
|
+
|
|
41
|
+
input("\npress enter for next question")
|
|
42
|
+
clear()
|
|
43
|
+
|
|
44
|
+
print(f"quiz is over: {score}/{len(df)}")
|
|
45
|
+
|
|
46
|
+
if len(wrong) > 0:
|
|
47
|
+
wrong_df = pd.DataFrame(wrong)
|
|
48
|
+
wrong_df.to_csv('mistakes.csv', index=False)
|
|
49
|
+
print(f"you got {len(wrong)} questions wrong, saved as mistakes.csv")
|
|
50
|
+
else:
|
|
51
|
+
if os.path.exists('mistakes.csv'):
|
|
52
|
+
os.remove('mistakes.csv')
|
|
53
|
+
print("perfect score! no mistakes")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def main():
|
|
57
|
+
current_dir=os.path.dirname(os.path.abspath(__file__))
|
|
58
|
+
csv_path=os.path.join(current_dir,'cards.csv')
|
|
59
|
+
|
|
60
|
+
currentdir = os.path.dirname(os.path.abspath(__file__))
|
|
61
|
+
csv_path= os.path.join(currentdir, 'cards.csv')
|
|
62
|
+
questions=pd.read_csv(csv_path)
|
|
63
|
+
while True:
|
|
64
|
+
clear()
|
|
65
|
+
print("welcome to mlquiz!\n")
|
|
66
|
+
print("1. take full quiz")
|
|
67
|
+
print("2. choose a category")
|
|
68
|
+
|
|
69
|
+
if os.path.exists('mistakes.csv'):
|
|
70
|
+
print("3. study mistakes")
|
|
71
|
+
|
|
72
|
+
print("4. quit")
|
|
73
|
+
|
|
74
|
+
choice = input("\nselect an option: ")
|
|
75
|
+
|
|
76
|
+
if choice == '1':
|
|
77
|
+
run_quiz(questions)
|
|
78
|
+
input("\npress enter to return to menu")
|
|
79
|
+
elif choice =='2':
|
|
80
|
+
categories=questions['category'].unique()
|
|
81
|
+
print("\ncategories:")
|
|
82
|
+
for i in range(len(categories)):
|
|
83
|
+
print(f"{i+1}. {categories[i]}")
|
|
84
|
+
choice=input("\npick a number ")
|
|
85
|
+
|
|
86
|
+
try:
|
|
87
|
+
index=int(choice)-1
|
|
88
|
+
if 0 <= index < len(categories):
|
|
89
|
+
selected=categories[index]
|
|
90
|
+
filtered = questions[questions['category']==selected]
|
|
91
|
+
run_quiz(filtered)
|
|
92
|
+
input("\npress enter to return to menu")
|
|
93
|
+
else:
|
|
94
|
+
print("invalid number")
|
|
95
|
+
input("press enter to reenter number")
|
|
96
|
+
except ValueError:
|
|
97
|
+
print("please type a number")
|
|
98
|
+
input("press enter to try again")
|
|
99
|
+
|
|
100
|
+
elif choice == '3' and os.path.exists('mistakes.csv'):
|
|
101
|
+
mistakes_df=pd.read_csv('mistakes.csv')
|
|
102
|
+
run_quiz(mistakes_df)
|
|
103
|
+
input("\npress enter to return to menu")
|
|
104
|
+
elif choice=='4':
|
|
105
|
+
break
|
|
106
|
+
|
|
107
|
+
if __name__ == "__main__":
|
|
108
|
+
main()
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
mlquiz/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
mlquiz/cards.csv,sha256=s_q2qaifQTpDzG4PKiGp7yx6NYYlXpx7yai0TjFuKUE,6869
|
|
3
|
+
mlquiz/main.py,sha256=a9RI78rcu1mj0cScGT6NNk_zLvMIQ9AHdwt3cgZDqjg,3612
|
|
4
|
+
mlquiz-0.1.0.dist-info/METADATA,sha256=KUo1tkiTV8BzMNsi3hPrU12nOmq7mj1DPvphhTKF5Kg,142
|
|
5
|
+
mlquiz-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
6
|
+
mlquiz-0.1.0.dist-info/entry_points.txt,sha256=Ck39Yr8YwRzJITXq0Mvt4J-E07O_t8WFF0PP_zQw4y4,44
|
|
7
|
+
mlquiz-0.1.0.dist-info/top_level.txt,sha256=dFNPDfMSifjhBGxvOccaeq_zow4KpjKM3YG0oHFFCAc,7
|
|
8
|
+
mlquiz-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mlquiz
|