Posts

Showing posts from July, 2017

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

Clustering and Similarity: Retrieving Documents Quiz Answers

1) Top word count words for Elton John (the, john, singer) (england, awards, musician) ( the, in, and) (his, the, since) (rock, artists, best) 2) Top TF-IDF words for Elton John (furnish,elton,billboard) (john,elton,fivedecade) (the,of,has) (awards,rock,john) (elton,john,singer) 3) The cosine distance between 'Elton John's and 'Victoria Beckham's articles (represented with TF-IDF) falls within which range? 0.1 to 0.29 0.3 to 0.49 0.5 to 0.69 0.7 to 0.89 0.9 to 1.0 4) The cosine distance between 'Elton John's and 'Paul McCartney's articles (represented with TF-IDF) falls within which range? 0.1 to 0.29 0.3 to 0.49 0.5 to 0.69 0.7 to 0.89 0.9 to 1 5) Who is closer to 'Elton John', 'Victoria Beckham' or 'Paul McCartney'? Victoria Beckham Paul McCartney 6) Who is the nearest neighbor to 'Elton John' using raw word counts? Billy Joel Cliff Richard Roger Daltrey George Bush 7) Who is

Machine Learning Foundation Clustering and Similarity Quiz Answers

1) A country, called Simpleland, has a language with a small vocabulary of just “the”, “on”, “and”, “go”, “round”, “bus”, and “wheels”. For a word count vector with indices ordered as the words appear above, what is the word count vector for a document that simply says “the wheels on the bus go round and round.” Please enter the vector of counts as follows: If the counts were ["the"=1, “on”=3, "and"=2, "go"=1, "round"=2, "bus"=1, "wheels"=1], enter 1321211. Enter answer here 2111211 2) In Simpleland, a reader is enjoying a document with a representation: [1 3 2 1 2 1 1]. Which of the following articles would you recommend to this reader next? a) [7 0 2 1 0 0 1] b) [1 7 0 0 2 0 1] c) [1 0 0 0 7 1 2] d) [0 2 0 0 7 1 1] 3) A corpus in Simpleland has 99 articles. If you pick one article and perform 1-nearest neighbor search to find the closest article to this query article, how many times must you compute the simil

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

Machine Learning Foundation - Summary of Regression - Quiz Answers

1. The simple threshold classifier for sentiment analysis described in the video (check all that apply): a) Must have pre-defined positive and negative attributes b) Must either count attributes equally or pre-define weights on attributes c) Defines a possibly non-linear decision boundary 2. For a linear classifier classifying between “positive” and “negative” sentiment in a review x, Score(x) = 0 implies (check all that apply): a) The review is very clearly “negative” b) We are uncertain whether the review is “positive” or “negative” c) We need to retrain our classifier because an error has occurred 3. For which of the following datasets would a linear classifier perform perfectly? b 4. True or false: High classification accuracy always indicates a good classifier. a) True b) False 5.  True or false: For a classifier classifying between 5 classes, there always exists a classifier with accuracy greater than 0.18. a) True b) False 6. True or false: A false ne

Generate Create and Insert script with data in sql

Image
Right click on the existing database and choose Tasks → Generate Scripts Select the database objects to script Go to Set Scripting Options and Specify how scripts should be saved or published Choose Output type .. Save script to a specific location and click on the Advance button In the General tab go to Types of data to script and Select the appropriate option and click on OK . It will generate the CREATE TABLE statement and all of the INSERT statements for the selected data