Find-S algorithm is a Machine Learning Algorithm that finds the most specific hypothesis that fits all the positive examples.
Project description
Find-S Algorithm
Find-S algorithm is a Machine Learning Algorithm that finds the most specific hypothesis that fits all the positive examples.
Installation
Install directly from my PyPi
pip install classic-FindS
Or Clone the Repository and install
python3 setup.py install
Parameters
* X_train
The Training Set array consisting of Features.
* y_train
The Training Set array consisting of Outcome.
Attributes
* fit(X_train, y_train)
Fit the Training Set to the model.
* predict(y_test)
Predict the Test Set Results.
Documentation
1. Install the package
pip install classic_FindS
2. Import the library
from classic_FindS import FindS
3. Create an object for FindS class
fs = FindS()
4. Fit your Training Set to the model
fs.fit(X_train, y_train)
5. Predict your Test Set results
y_pred = fs.predict(y_test)
Example Code
1. Import the dataset and Preprocess
- import numpy as np
- import pandas as pd
- dataset = pd.read_csv('Covid-19_Data.csv')
- result = {'Yes':1, 'No':0}
- dataset['Covid_19'] = dataset['Covid_19'].map(result)
- X = dataset.iloc[:, 0:5].values
- y = dataset.iloc[:, -1].values
- from sklearn.model_selection import KFold
- kf = KFold(n_splits=10)
- for train_index, test_index in kf.split(X,y):
- X_train, X_test = X[train_index], X[test_index]
- y_train, y_test = y[train_index], y[test_index]
2. Use the Find-S Library
- from classic_FindS import FindS
- fs = FindS()
- S_hypothesis = fs.fit(X_train, y_train)
- print("Specific Hypothesis : ", S_hypothesis)
- y_pred = fs.predict(X_test)
Footnotes
You can find the code at my Github.
Connect with me on Social Media
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for classic_FindS-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5d5c320417a4fed9638e5c7516c07cb2fc36ccd489fec9803338b87e56528ba |
|
MD5 | 76fc5a0b236157b75cf36dad5ffb7037 |
|
BLAKE2b-256 | b5c5c69fa07d82dd823871e89010e4a182a305d2d543f6e2e17eb747fa87edce |