Candidate-Elimination Algorithm is a Machine Learning Algorithm that builds the version space from Specific Hypothesis and General Hypothesis.
Install directly from my PyPi
pip install classic-CandidateElimination
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_CandidateElimination import Candidate_Elimination
ce = Candidate_Elimination()
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_CandidateElimination import Candidate_Elimination
- ce = Candidate_Elimination()
- ce.fit(X_train, y_train)
- y_pred = ce.predict(X_test)
You can find the code at my Github.