Skip to content

Homework 2

Jinho D. Choi edited this page Feb 12, 2018 · 10 revisions

Preparation

Course Trend

Complete the following function in hw2.py that takes course_info and returns a dictionary where the key is a course ID (e.g., CS170) and the value is the likelihood of that course being offered in the Fall and Spring terms; in other words, the value is a tuple of two floats (e.g., (0.4, 0.6)) where the first and the second floats represent the likelihoods of the Fall and Spring terms being offered, respectively.

def course_trend(course_info):
    """
    :param course_info: the output of load_course_info().
    :return: a dictionary where the key is a course ID and the value is the likelihood of that course being offered in the Fall and Spring terms. 
    """
    pass

In your report, describe how you measure the likelihoods.

Special Topics

Complete the following function in hw2.py that takes course_info and returns a dictionary where the key is a professor name (e.g., 'Jinho D Choi') and the value is the list of the professor's special graduate courses ranked in descending order.

def special_topics(course_info):
    """
    :param course_info: the output of load_course_info().
    :return: a dictionary where the key is a professor name (e.g., 'Jinho D Choi') and the value is the professor's
             special graduate courses excluding research courses ranked in descending order.
    """
    pass

In your report, describe how you rank each professor's graduate courses.

Similarity

Complete the following function in hw2.py that

  1. takes course_info
  2. measures cosine similarities between all pairs of professors
  3. creates a dictionary whose key is a professor name (last name, First name) and the value is a list of pairs where each pair represents (another professor name, similarity score between the key professor and another professor).
  4. returns the dictionary.
def similarity(course_info):
    """
    :param course_info: the output of load_course_info().
    :return: whose key is a professor name (last name, First name) and the value is a list of pairs where each pair 
            represents (another professor name, similarity score between the key professor and another professor).
    """
    pass

Vector Plot

Complete the following function in hw2.py that that takes course_info and creates vectors for all professors with respect to their graduate courses and plot them into a 2D space using t-SNE.

def vector_plot(course_info):
    pass

Note that t-SNE may produce different results every time you run. Include several plots in your reports and explain which ones make sense. Also, discard instructors who have not taught any graduate course.

Submission

Submit the followings to: https://canvas.emory.edu/courses/41979/assignments/118258

  • hw1.py: including the code assigned above.
  • hw1.pdf: the report describing your approaches.

Practical Approaches to Data Science with Text

Instructor


Emory University

Clone this wiki locally