SQL Joins

Image
Joins are used to combine rows from two or more tables based on related columns between them. Joins allow you to retrieve data from multiple tables simultaneously, enabling you to create complex queries that fetch data from different sources. There are different types of joins in SQL, including: INNER JOIN Returns only the rows that have matching values in both tables based on the specified join condition. It discards non-matching rows from both tables. Example:           create table t1(x int); insert into t1 values(1); insert into t1 values(1); insert into t1 values(0); create table t2(y int); insert into t2 values(0); insert into t2 values(1); insert into t2 values(1);           select * from t1 inner join t2 on t1.x = t2.y Output: 2. LEFT JOIN (or) LEFT OUTER JOIN Returns all the rows from the left (or first) table and the matching rows from the right (or second) table. If there is no match, NULL values are

Machine Learning specialization Classification Quiz Answers

1) Out of the 11 words in selected_words, which one is most used in the reviews in the dataset?


awesome
love
hate
bad
great

2) Out of the 11 words in selected_words, which one is least used in the reviews in the dataset?


wow
amazing
terrible
awful
love

3) Out of the 11 words in selected_words, which one got the most positive weight in the selected_words_model?
(Tip: when printing the list of coefficients, make sure to use print_rows(rows=12) to print ALL coefficients.)

amazing
awesome
love
fantastic
terrible

4) Out of the 11 words in selected_words, which one got the most negative weight in the selected_words_model?
(Tip: when printing the list of coefficients, make sure to use print_rows(rows=12) to print ALL coefficients.)

horrible
terrible
awful
hate
love

5) Which of the following ranges contains the accuracy of the selected_words_model on the test_data?

0.811 to 0.841
0.841 to 0.871
0.871 to 0.901
0.901 to 0.931

6) Which of the following ranges contains the accuracy of the sentiment_model in the IPython Notebook from lecture on the test_data?

0.811 to 0.841
0.841 to 0.871
0.871 to 0.901
0.901 to 0.931

7) Which of the following ranges contains the accuracy of the majority class classifier, which simply predicts the majority class on the test_data?

0.811 to 0.843
0.843 to 0.871
0.871 to 0.901
0.901 to 0.931

8) How do you compare the different learned models with the baseline approach where we are just predicting the majority class?

They all performed about the same.
The model learned using all words performed much better than the one using the only the selected_words. And, the model learned using the selected_words performed much better than just predicting the majority class.
The model learned using all words performed much better than the other two. The other two approaches performed about the same.
Predicting the simply majority class performed much better than the other two models.

9) Which of the following ranges contains the ‘predicted_sentiment’ for the most positive review for ‘Baby Trend Diaper Champ’, according to the sentiment_model from the IPython Notebook from lecture?

Below 0.7
0.7 to 0.8
0.8 to 0.9
0.9 to 1.0

10) Consider the most positive review for ‘Baby Trend Diaper Champ’ according to the sentiment_model from the IPython Notebook from lecture. Which of the following ranges contains the predicted_sentiment for this review, if we use the selected_words_model to analyze it?

Below 0.7
0.7 to 0.8
0.8 to 0.9
0.9 to 1.0

11) Why is the value of the predicted_sentiment for the most positive review found using the sentiment_model much more positive than the value predicted using the selected_words_model?

The sentiment_model is just too positive about everything.
The selected_words_model is just too negative about everything.
This review was positive, but used too many of the negative words in selected_words.
None of the selected_words appeared in the text of this review.

Assignment 1 hint:

def awesome_count(x):
    if 'awesome' in x:
        return x['awesome']
    else:
        return 0

products['awesome'] = products['word_count'].apply(awesome_count)

print products['awesome'].sum()

Use the above function and repeat for the remaining selected words to get the solution.

Comments

Post a Comment

Popular posts from this blog

Machine Learning Foundations - Deep Learning Summary - Quiz

Machine Learning Foundation - Deep Learning - Programming Assignment

Machine Learning Foundations - Recommender System - Quiz