Find-S algorithm is a Machine Learning Algorithm that finds the most specific hypothesis that fits all the positive examples.
Install directly from my PyPi
pip install classic-FindS
Or Clone the Repository and install
python3 setup.py install
The Training Set array consisting of Features.
The Training Set array consisting of Outcome.
Fit the Training Set to the model.
Predict the Test Set Results.
pip install classic_FindS
from classic_FindS import FindS
fs = FindS()
fs.fit(X_train, y_train)
y_pred = fs.predict(y_test)
- 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]
- 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)
You can find the code at my Github.