<jupyter_start><jupyter_text>How do you convert a string to a float and vice versa in Python?<jupyter_code>x = "1123"
y = float(x)
type(y)
z = str(y)
type(z)<jupyter_output><empty_output><jupyter_text>What is backpropagation?  A technique for training neural networks that uses gradient decent to take previous loss and use it to improve future iterations of the model and adjust weight for neurons  How to combine two one-dimensional lists into one one-dimensional list?<jupyter_code>list_1 = [1,2,3,4,5]
list_2 = [6,7,8,9,10]
list_3 = list_1 + list_2
list_3<jupyter_output><empty_output><jupyter_text>What does the HAVING clause do in SQL?  basically a for clause in SQL. I.e. All animals having 3 arms-> For all animals w/ 3 arms, give me data  What is the difference between an inner join and a left outer join?  Inner join combines all similar A and B data whereas left outer keeps all of A and any extra A data becomes null for B values  What is PEP-8?  Styling guide used for writing python code  What are some different ways to treat missing values?  Impute (mean of column, mean of group), drop. All depends on the amount of missing variables. (5% missing can just keep going)?  What is the difference between artificial intelligence and machine learning?  AI is the field whereas machine learning is taking in data to perform analysis on the data based on algorithms   What are some metrics for evaluating the performance of linear regression?  R**2, MAE, MSE, MAPE, MPE  What are some metrics for evaluating the performance of classification?  Log loss(smaller the better, penalize misclassification more), Accuracy (Precision and Recal), AUC.  Write a function that asks the user for a string, then print whether the string is a palindrome. A palindrome is a string that reads the same forwards and backwards.<jupyter_code>string = input('please type something :D ')
l_string = string.lower()
b_string = l_string[::-1]
if l_string == b_string:
    print(f'{string} is a palindrome')
else:
    print(f'{string} is not a palindrome')<jupyter_output>please type something :D Hannah
Hannah is a palindrome<jupyter_text>What does the LIMIT clause do in SQL?  limits the amount of results that are returned in a SQL query  What is underfitting and how do you prevent it?  a model that is not trained enough to predict the target. Adding features and data prevents this  What is a nonparametric model? What are its advantages and disadvantages?  Model with no assumptions about a variable's distribution. More flexible less powerful insights. Good when you have a lot of data and no prior knowledge, and when you don’t want to worry too much about choosing just the right features. EG:- Decision Trees- K-Nearest Neighbor- Support Vector Machines with Gaussian Kernels- Artificial Neural Networks  What is a parametric model? What are its advantages and disadvantages?  A learning model that summarizes data with a set of parameters of fixed size (independent of the number of training examples). No matter how much data you throw at a parametric model, it won’t change its mind about how many parameters it needs. Some examples of parametric machine learning algorithms are:- Linear Regression- Linear Support Vector Machines- Logistic Regression- Naive Bayes- Perceptron  What is the difference between a for loop and a while loop?  For goes through the elements, while does something while a condition is met  What is the difference between statistics and machine learning?  stats is the study of casual relations with data driven hypothesis. Machine learning is using programed algorithms with predictive accuracy  What is the output of -12 // 10?  -2. The double dash divides into a whole number without including remainders  Write a function that asks the user for a number and then prints out a list of all the divisors of that number.<jupyter_code>nums = int(input('Please type a number: '))
parts = list(range(1, nums+1))
divisors = []

for number in parts:
    if nums%number==0:
        divisors.append(number)

print(divisors)<jupyter_output>Please type a number: 30
[1, 2, 3, 5, 6, 10, 15, 30]<jupyter_text>When might you use a random forest versus a support vector machine and why? - Random forest is really good for multiple perpendicular lines- SVM is super good for multi-dimensional classification  The Fibonnaci sequence is a sequence of numbers where the next number in the sequence is the sum of the previous two numbers in the sequence. The sequence looks like this: 1, 1, 2, 3, 5, 8, 13, … Write a function that asks the user how many Fibonnaci numbers to generate and then generates them.<jupyter_code>def fib_nums(quantity):
    fib_num = []
    i=1
    if nums == 0:
        print("Smart. You'll get nothing and like it.")
    elif nums == 1:
        fib_num = 0
    elif nums == 2:
        fib_num = [1,0]
    elif nums > 2:
        fib_num = [1,1]
        while i < (nums-1):
            fib_num.append(fib_num[i]+fib_num[i-1])
            i+=1

    return fib_num


nums= int(input('How many fibonnaci numbers do you want?: '))
print(fib_nums(nums))<jupyter_output>How many fibonnaci numbers do you want?: 10
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]<jupyter_text>What is an autoencoder?  Something for reconstructing the original image with a bootleneck in the middle  What is bagging and boosting in an ensemble model? - Bagging is when features have the same probablility to appear in the dataset- Boosting is when observations are weighted  What is a loss function in a neural network?  A loss function is a function that describes the amoutn of unexplained data in a machine learning model  What is an RDBMS?  A relational database management system maintains data records and fields in tables. Relationships between data entities are expressed in these tables.  What is regularization and why is it useful?  Regularization helps to prevent overfitting and helps with generalizing a model. Lasso, Ridge, and Elasticnet are examples.- Ridge is good for penalizing large coeficients.- Lasso is good for being able to shrink to 0 and not penalizing large coef as much. useless var too  Explain a false positive and false negative. When might one be more important than another?  A false positive means the qualification is not met but the algorithm returns a positive. This could be bad for predicting a stock increase or a positive benefit from certain chemical compounds when they are actually harmful A false negative is something that should be positive, but is actually negative. This is bad for most medical tests as well as weapon detection in airports  What are the main types of distributions and phenomena that follow these distributions? - Bernoulli: Countable number of possible values done one time - Coin flip, die toss, etc.- Binomial: Count the number of successes of an event with two or more distinct outcomes. Massive repetition of Bernoulli - Any bernoulli thing done a ton- Gausian: Normal distribution- Poisson: How many times something happens during a time interval    -Phone calls to a radio show- Gamma: The time until something happens (Starts out unlikely, more likely then unlikely again). Waiting time between poisson distributed events - People dying, Amount of people arriving   Write a function that takes a list and returns a new list containing all unique elements of the first list (i.e., no duplicates).<jupyter_code>def find_duplicates(list):
    new_list = []

    for elem in range(len(list)):
        if list[elem] not in new_list:
            new_list.append(list[elem])

    print(new_list)

user_time = input('please type a list')
user_time = user_time.split()
find_duplicates(user_time)<jupyter_output>please type a list1 5 6 6 85 8 5 5 3 
['1', '5', '6', '85', '8', '3']<jupyter_text>Why is the area under the curve a better evaluation metric than raw accuracy?  Under the curve looks at the entire dataset rather than at specific cutoff points  What is the bias/variance tradeoff?  Too simple(few features) could have high bias and low variance, but with too many features it can have a higher variance. - Bias:Data skews the same direction/degree- Variance: Prediction is off by a ton  Make a two-player Rock-Paper-Scissors game. Ask the players to input plays, compare them, then print a message of congratulations to a winner and ask if the players want to play again.<jupyter_code>def rpz_game(move_1, move_2):
    if move_1 == 'rock':
        if move_2 == 'paper':
            print(f'Congratulations {player_2} wins!')
        elif move_2 == move_1:
            print("It's a tie!")
        elif move_2 =='scissors':
            print(f'Congratulations {player_1} wins!')
        else:
            print('Beep boop can not compute')
    elif move_1 == 'paper':
        if move_2 == 'scissors':
            print(f'Congratulations {player_2} wins!')
        elif move_2 == move_1:
            print("It's a tie!")
        elif move_2 == 'rock':
            print(f'Congratulations {player_1} wins!')
        else:
            print('Beep boop can not compute')
    elif move_1 =='scissors':
        if move_2 == 'rock':
            print(f'Congratulations {player_2} wins!')
        elif move_2 == move_1:
            print("It's a tie!")
        elif move_2 == 'paper':
            print(f'Congratulations {player_1} wins!')
        else:
            print('Beep boop can not compute')
    else:
        print('Beep boop can not compute')
player_1 = input("Player 1, please type your name: ")
player_2 = input("Player 2, please type your name: ")
move_1 = input(f"{player_1}, please type 'Rock', 'Paper', or 'Scissors': ")
move_2 = input(f"{player_2}, please type 'Rock', 'Paper', or 'Scissors': ")
move_1 =  move_1.lower()
move_2 = move_2.lower()

rpz_game(move_1, move_2)<jupyter_output>Player 1, please type your name: Thinkful
Player 2, please type your name: Chegg
Thinkful, please type 'Rock', 'Paper', or 'Scissors': Rock
Chegg, please type 'Rock', 'Paper', or 'Scissors': Scissors
Congratulations Thinkful wins!<jupyter_text>What is selection bias?  When a sample isn't representitive of an entire population (sampling, lack of quantity of responses, etc.)  What are precision and recall? - Precision: Amount of positive predictions that were correct (TP/TP+FP)- Recal: Amount of actual positives that were identified correctly(TP/TP+FN)  What is a perceptron  A perceptron is an algorithm for supervised classification of the input into one of several possible non-binary outputs.  Write a function that takes a list of numbers and returns a list of only the first and last elements of that list.<jupyter_code>def list_end(list):
    print(list[0], list[-1])
pls_work = [1,2,3,4,5]
list_end(pls_work)<jupyter_output>1 5
{'fraction_non_alphanumeric': 0.0673202614379085, 'fraction_numerical': 0.014098972922502334, 'mean_word_length': 4.028638497652582, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '398648', 'license': 'MIT', 'n_tokens_mistral': 3077, 'n_tokens_neox': 2883, 'n_words': 1488, 'path': 'Tech interview prep.ipynb', 'repo_name': 'AsterLaoWhy/Thinkful', 'size': '10710'}