Developed by Piyush Pant with ❤️          From INDIA Indian flag 2023           Last Update: June 2023 (The package and documentation is under development)

Get started with MAIVE

MAIVE (मैव) is a powerful python package equipped with advanced mathematics to assist you in the domain of Artificial Intelligence while also providing you with visualization support. The mathematics level begins from high school to advanced, any topic that may be required in the AI domain is provided in the MAIVE. Please understand that the package is still under development, so there might be missing topics (which will be added soon). To become a contributor or if you want to suggest something, please contact us via Whatsapp or through the Webpage .

# Installation

$ pip install maive

Copy the above code, paste it in your terminal and you are good to go!

Documentation

Please visit the section as per your requirements. It is advised to read the HOW TO USE? section before using the package.

  • To import the package

    from maive.maive import Maive
    M = Maive()
    isAP = M.AP_checkIfAP([10,1,34])
    print(isAP)

    OR

    from maive import maive
    M = maive.Maive()
    isAP = M.AP_checkIfAP([10,1,34])
    print(isAP)

  • All the functions follow a naming convention. A function's naming is divided in two parts with underscore(_). The before underscore is the domain of mathematics that the function belongs to and the part after underscore is the name of the function. for example, the function to generate an AP which is from Arithmetic Progression domain will be like - AP_generateAP()
    however, there is an exception for global functions like isPerfectSquare()

  • To ensure better performance, please input data with their respective keywords when working with functions. For example, QE_typeOfRoots(a=100, b=-455, c=97) where a,b and c are the coefficients of the quadratic equation.

  • confusionMatrix()

    Returns the confusion matrix for your ML model. (For Logistic regression model)
    Input as - confusionMatrix(model, x, y)
    where model = logistic regression model. x = input, and y = target

  • r2(model, x, y)

    Returns the R2 of the ML model. Input as - r2(model, x , y)
    1. model - linear model
    2. x - reshaped input array
    3. y - target data array

  • adjustedR2()

    Returns the adjusted R2 of the ML model. Input as => adjustedR2(model, x, y)

  • bias()

    Returns the bias of the model.
    Input the trained model as bias(model) [Linear model preferrably]

  • weights()

    Returns the weight(s) of the features.
    Input the trained model as weights(model) [Linear model preferrably]

  • regressionReport()

    Provides you with the report of your Regression which contains info like weights, bias, p-value, etc as a dataframe.
    Input x and y (reshaped)

  • scatterPlot()

    Returns scatter plot of the input x and y along with their labels, title, etc. Input in sequence as-
    scatterPlot( x, y, xlabel, ylabel, title)

  • distPlot()

    Returns the distribution of the feature passed. Please ensure the array is optimally reshaped.

  • p_value(x, y)

    Returns the p-value of the model.
    Input the X and Y (reshaped)

  • f_stats(x, y)

    Returns the f-stats of the model.
    Input the X and Y (reshaped)

  • logisticReport( x ,y)

    Returns logistic report as a dataframe. Input x and y (reshaped)

  • summaryTable(x, y)

    Returns a dataframe that shows the summary of the Linear regression model.
    Input as - summaryTable(x, y)
    x = input data (with feature names), y = target data

  • Cluster()

    Function to perform the clustering of the provided dataset using KMeans algorithm. Please input the following
    x = data (reshaped), k = No. of clusters

  • elbowMethod()

    Returns the graph of the elbow method showing WCSS for number of clusters.
    Input the training data only.
    NOTE - The number of cluster value K is preset i.e. the function calculates WCSS for clusters from 1 to 10 clusters

  • LinearRegression()

    Returns the trained Linear Regression model.
    Input as - LinearRegression( x , y )
    where x = input data, y = target data
    Note: Please ensure data format is compatible.

  • LogisticRegression()

    Returns the trained Logistics Regression model.
    Input as - LogisticRegression( x , y )
    where x = input data, y = target data
    Note: Please ensure data format is compatible.

  • createNPZ()

    Saves the given data file in NPZ format.
    Input in the given sequence = (filename, x, y)

  • createCSV()

    Saves the given data file in CSV format.
    Input in the given sequence = (filename, data)

  • featureScaling()

    Performs feature scaling on the given training data x.
    It returns-
    1. Scaled train data as scaled_x
    2. scaler (StandardScaler()) by which the data is scaled

  • logisticModelAccuracy(model, x, y)

    Returns the accuracy of your ML model. (For Logistic regression model)
    Input as - logisticModelAccuracy(model, x, y)
    where model = logistic regression model. x = input, and y = target

  • nn(**kwargs)

    To create your basic Neural Network for classification (It is advised to try to train your own NN for better results)
    Input keyworded arguments as:
    1. x = training data aka input
    2. y = target data
    3. t = target size (output nodes in output layer)
    4. e = Epochs
    NOTE: The NN uses SOFTMAX activation function for its only layer. loss function = 'mean_squared_error' optimizer = 'sgd'

  • P_probability()

    To find the probability of an event. Please input the keyworded arguments as s = sample space, e = favourable event
    It returns the probability of the event, between 0 and 1.

  • P_isIndependentEvent()

    Function to check if two events are independent or not.

    Please input the following:
    1. Set of event A and event B in LIST datatype as "a" and "b", otherwise Probability of A intersection B as "pab"
    2. Probabily of event A as pa and event B as pb. This function returns TRUE if events are independent, otherwise FALSE

  • P_frequency(listOfEvents, event)

    Function to return the frequency (in numbers) of an event in a given list of events.
    It returns the frequency of given event as a positive integer. Please do make sure to input the events in LIST.

  • P_frequencyDistribution(dataInListForm)

    Function to generate a frequency distribution table. Returns a dictionary with keys as list data items and values as their respective frequency.
    Please enter the data in list format.
    for [ 'a' , 'a' , 'b' , 'c' , 'd' ]
    returns { 'a' : 2 , 'b' : 1 , 'c' : 1 , 'd' : 1 }

  • P_relativeFrequency(data)

    Function to generate a RELATIVE frequency distribution table. Returns a dictionary with keys as list data items and values as their respective relative frequency.
    Please enter the data in list format.
    for [ 'a' , 'a' , 'b' , 'b' ]
    returns { 'a' : 0.5 , 'b' : 0.5 }

  • P_compliment(a)

    Function to return the compliment of an event. Please input the probability of the event as argument.

  • probabilityDistributionFunction(data)

    Returns the graph of Probability Distibution Function. Input the data as an attribute (LIST)

  • P_conditionalProbability()

    Function to return the conditional probability i.e. P(a|b). Please input keyworded arguments as
    CASE A: 'pab' Probability of A intersection B and 'pb' Probability of event B with 's' as sample space
    NOTE: If you don't have pab and pb, then enter
    CASE B: 'a' List of set A and 'b' List of set B with 's' as sample space
    It will return the INT/FLOAT value which is result of P(a|b)

  • mean(list)

    Returns the mean value of the sample presented as a LIST

  • mode(list)

    Returns the mode value of the sample presented as a LIST

  • median(list)

    Returns the median value of the sample presented as a LIST

  • varianceS(list)

    Returns the variance of the SAMPLE presented as a list

  • varianceP(list)

    Returns the variance of the POPULATION presented as a list

  • standardDeviationS(list)

    Returns the standard deviation of Sample passed as a list

  • standardDeviationP(list)

    Returns the standard deviation of population passed as a list

  • covariance(x,y)

    Returns the covariance between two features x and y passed as a list

  • correlation(x,y)

    Returns the correlation between two features x and y passed as a list

  • AP_generateAP()

    Function to generate an Arithmatic Progression. Please pass a (First term), d (difference) and n (number of terms) as keyworded arguments. If you do not pass anything, the function will return an Arithmatic progression of 10 terms with random a and d.

  • AP_checkIfAP()

    Function to check if a series is an Arithmatic progression or not. Pass the series in form of LIST as argument. The output will be a boolean value i.e. TRUE or FALSE.

  • AP_findNthElement()

    Function to find the nth element of an Arithmatic Progression. Please provide a (First term), d (difference) and n (number of terms) as keyworded arguments.

  • AP_findN()

    Function to determine the n. Please provide a (First term), d (difference) and an (the nth term) as keyworded arguments.

  • AP_findDifference()

    Function to determine the difference d of an Arithmatic Progression. Please provide a (First term), n (number of terms) and an (the nth term) as keyworded arguments.

  • AP_findSum()

    Function to determine the sum of an Arithmatic Progression. Please provide a (First term), n (number of terms) and d (difference) as keyworded arguments.

  • QE_roots()

    Function to return the roots alpha and beta (A quadratic equation only has 2 roots) of the quadratic equation. It returns a Dictionary with keys alpha and beta as roots. Please provide a (coefficint of x2 ), b (coefficient of x) and c(constant term) as keyworded arguments.

  • isPerfectSquare()

    Function to verify if the given number is a perfect square or not, returns Boolean

  • QE_typeOfRoots()

    Function to return the type of roots the quadratic equation has. Please provide a (coefficint of x2 ), b (coefficient of x) and c(constant term) as keyworded arguments.