Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/georgiifirsov/machinelearningmodels

Library with implementation of several machine learning models. It is written in Python 3 with numpy.
https://github.com/georgiifirsov/machinelearningmodels

ai artificial-intelligence machine-learning ml pyhton pyhton3

Last synced: 10 days ago
JSON representation

Library with implementation of several machine learning models. It is written in Python 3 with numpy.

Awesome Lists containing this project

README

        

# MachineLearningModels

This repository contains machine learning models implementation in Python 3.

You can look for some examples in files Example\.ipynb.

### Currently implemented
- [Generalized linear regression (with polynomials)](./ExampleLinearRegression.ipynb)
- [Multiple linear regression](./ExampleMultipleLinearRegression.ipynb)

### Usage

Usage of these models is really simple - you just need to import required model class and fit it with your data.

#### Generalized linear regression
```python
from MachineLearning.LinearRegression import LinearRegression
from MachineLearning.Metrics import mean_squared_error

model = LinearRegression(degree=3)

model.fit(X_train, y_train)
y_pred = model.predict(X_test)

print(mean_squared_error(y_pred, y_test))
```

#### Multiple linear regression
```python
from MachineLearning.MultipleLinearRegression import MultipleLinearRegression
from MachineLearning.Metrics import mean_squared_error

model = MultipleLinearRegression()

model.fit(X_train, y_train)
y_pred = model.predict(X_test)

print(mean_squared_error(y_pred, y_test))
```