Session Ready
Exercise

Install the package

Now you're ready to install the package for use. It's important to note that setup.py does not contain information about dependent packages, like pandas and statsmodels. While the setup.py file can define these packages we're going to use Conda Build in the next chapter to define and install dependent packages. For now in order to use the package we must have pandas, statsmodels, and scipy installed.

The forecast conda environment has been created and activated for you. In this exercise you'll install the mortgage_forecasts package and verify that you can import and run it.

Instructions 1/3
undefined XP
  • 1

    To install the package in your environment execute the setup.py file with install as the first argument.

    Notice that the package is installed in the forecast Conda environment.

    python setup.py install
    
    • 2

      In order to fit the MortgageRateModel autoregressive model you'll need to read mortgage rate data from the St. Louis Federal Reserve. The data has been downloaded for you.

      Change directory to /home/repl/practice, where the data has been placed.

    • 3

      In the Python shell import MortgageRateModel and read_data from the mortgage_forecasts package and call:

      • read_data() with the argument mortgage_rates.csv -> df
      • MortgageRateModel() with the argument df -> model
      • model.forecast() with the argument 'January 2019'

      You can continue to inspect the help() of the package, functions, and classes.

      Exit the interpreter when you're done.