Python package with DescribeLinearModel Class for calculating correlation and regression line of data points
- Python 3 with libraries numpy, matplotlib, sys, os
Use the package manager pip to install DescribeLinearModel.
pip install DescribeLinearModel
This pure python package is a Class for calculating correlation and regression line of data points and can be used as follows:
- Import library DescribeLinearModel:
from DescribeLinearModel import DescribeLinearModel
- New object object_name with the DescribeLinearModel class can be initiated with following command:
object_name = DescribeLinearModel(x_data, y_data)
x_data and y_data are lists of floats
- New object object_name with the DescribeLinearModel class has following methods:
object_name.read_file_x_data("x_data.txt", True)
reads in x coordinates of data points from a txt file
object_name.read_file_y_data("y_data.txt", True)
reads in y coordinates of data points from a txt file
object_name.set_data_point(new_x, new_y)
appends new data point to existing data attributes (x_data, y_data)
object_name.change_data_point(index_data_point, new_x, new_y)
overwrites existing data point from existing data attributes (x_data, y_data)
object_name.calculate_slope()
calculates the slope of the regression line from all data points
object_name.calculate_intercept()
calculates the y-intercept c of the regression line from all data points
object_name.calculate_r()
calculates pearson's correlation coefficient r from all data points
object_name.calculate_r_squared()
calculates the coefficient of determination r_squared from all data points
object_name.plot_scatterplot()
outputs a scatterplot including a regression line of the instance variable data object_name
DescribeLinearModel python package is uploaded on PyPi
- folder DescribeLinearModel containing:
- DescribeLinearModel.py - python file with code of class DescribeLinearModel
- DescribeLinearModel_unittest.py - python file with unittests of DescribeLinearModel class
- init.py - python file to execute DescribeLinearModel class when loading the module
- setup.cfg - Python package setup configuration file
- LICENSE.md - markdown file with license.md for this software package
- README.md - markdown file with instructions how to install and use this python package
- setup.py - python setup file with metadata about the package, necessary for pip installing
This project is licensed under the terms of the MIT license
Author: Eugen Iftimoaie
For questions feel free to contact me on my e-mail adress: eugen.iftimoaie@gmx.de