Documentation

naivepy.naivepy module

class naivepy.naivepy.Naive(filename: str, sample_list: list, target_column: str)

Bases: object

Naive Bayes Algorithm which can take only two values from a targeted column label

Parameters: filename : name of the file must be in csv format sample_list : list of tuples want to compare target_column : Target column is single only or comparing column

property getans: float

Returns the ans of the classified model

Returns:

float : returns the ans of the model.

property getdata: DataFrame

Returns the Loaded filename data.

Returns:

Dataframe : Return data in pandas.dataframe.

property getlabel: str

Returns classified Label after comparing.

Returns:

str : Returns Label in String.

naivepy.exceptions module

exception naivepy.exceptions.FormatNotSupported(filename: str)

Bases: Exception

Raises when filename format is not in .csv format

exception naivepy.exceptions.MaxTargetValueException(countss: int)

Bases: Exception

Raises when target column contains types of value more than 2

exception naivepy.exceptions.ValueNotFoundException(filename: str, value: str)

Bases: Exception

Raises when the value from the sample list is not in the loaded filename.csv

exception naivepy.exceptions.WrongTargetColumnException(filename)

Bases: Exception

Wrong target column Exception when the column is not present in the data