练习matplotlib绘图库的使用,进行数据分析。
Requirement
In this assignment we will further build upon our analysis of the transcripts
from the reality TV show “Keeping Up With The Kardashians” from where we left
off since Assignment 1. We will try to uncover some simple social dynamics
that are shown through language using various statistical and linguistic
techniques to better understand conversational behavior.
Instructions
Follow the instructions below to get the necessary packages installed and set
up your Python environment, then open the attached Jupyter notebook.
Run the notebook and complete the tasks contained in it, then upload the
completed notebook and an HTML copy of it to CMS.
Learning Objectives
This project aims to help you get comfortable working with the following tools
/ technologies / concepts:
- Standard/Generalized Jaccard similairty
- Plotting heatmaps in matplotlib
- Advanced numpy functionality
- Gender and Social Interaction Analysis
Setting up your environment
System Configuration
Perform the following steps in order:
Check your Version of Python3 (should be 3.5)
You can check via:
> python3 –version
Python 3.5.2
If your version differs, then download 3.5 here.
Get PyPI (Python Package Index)
PyPI allows one to easily download Python modules required to run the project,
as well as ones that may help you perform certain tasks in the future of the
course. PyPI is essential. As such, run:
> python3 get-pip.py
Download Virtualenv
Virtualenv helps establish an isolated Python environment. The environment
allows you to separate project-specific dependencies and their versions from
the Python modules installed locally on your computer. Once you have
virtualenv, cd into the directory where the extracted assignment is stored
(e.g. assignment1), and run:
> virtualenv -p python3 venv
This creates a virtual environment called venv. In order to enter than virtual
environment, run the following:
> source venv/bin/activate
The following command line prompt will indicate that you’re in the virtual
environment:
> (venv) >
To deactivate the virtual environment, run the following:
> (venv) > deactivate
>
Whenever you work with this project, you should always be in your virtual
environment. Without this isolation, we might run into module versioning
issues and other problems when trying to run your project, which creates
administrative overhead.
Install Dependencies
At the root of directory of the project skeleton code, run the following:
(venv) > pip3 install -r requirements.txt
This installs within your virtual environment all the necessary modules that
are required at the beginning of the project.
Setup Jupyter Notebook
To use your virtualenv as the kernel for your Jupyter Notebook you run the
following:
(venv) > python3 -m ipykernel install –user –name=venv
Open Jupyter Notebook and start working
Open the Jupyter Notebook enviroment and complete the assignment. Make sure to
go to Kernel - Change Kernel and click venv as the option.
> source venv/bin/activate
(venv) > jupyter notebook