MentDB, The digital brain.  About us Home
Back / All functions / Predictive analysis

Here you can make your predictive analysis.

pa xy_scatterpa xy_scatterpa rl loadpa rl load_from_jsonpa rl load_emptypa rl existpa rl showpa rl add_datapa rl slopepa rl interceptpa rl predictpa rl intercept_std_errpa rl mean_square_errorpa rl countpa rl rpa rl sum_squarespa rl r_squarepa rl significancepa rl slope_confidence_intervalpa rl slope_std_errpa rl sum_squared_errorspa rl total_sum_squarespa rl x_sum_squarespa rl slope_confidence_intervalpa rl closepa rl close_allpa rm loadpa rm load_from_jsonpa rm set_no_interceptpa rm calculate_adjusted_r_squaredpa rm calculate_residual_sum_of_squarespa rm calculate_r_squaredpa rm calculate_total_sum_of_squarespa rm estimate_error_variancepa rm estimate_regressand_variancepa rm estimate_regression_standard_errorpa rm estimate_regression_parameters_variancepa rm estimate_residualspa rm estimate_regression_parameters_standard_errorspa rm estimate_regression_parameterspa rm predictpa rm existpa rm showpa rm closepa rm close_all

pa xy_scatter <jsonArray>

Description

    Show a predictive analysis scatter

Parameters

    jsonArray:   The json array of x,y - string - required
admin
pa xy_scatter "[ [1.0, 2.0], [1.0, 2.2], [1.0, 2.5], [1.2, 2.0], [1.11, 0.9], [5.0, 3.0], [5.2, 3.08], [5.1, 3.0], [5.15, 2.9] ]"
mentdb
In editor ...

pa xy_scatter <cmId> <fieldX> <fieldY> <sqlSource>

Description

    Show a predictive analysis scatter

Parameters

    cmId:   The database connection id - string - required
    fieldX:   The field X - string - required
    fieldY:   The field X - string - required
    sqlSource:   The select query (origin) - string - required
admin
pa xy_scatter "demo_cm_mysql" "id" "quantity" "select * from products limit 0, 500"
mentdb
In editor ...

pa rl load <regId> <cmId> <fieldX> <fieldY> <sqlSource>

Description

    Load a linear regression from the database

Parameters

    regId:   The regression id - string - required
    cmId:   The database connection id - string - required
    fieldX:   The field X - string - required
    fieldY:   The field X - string - required
    sqlSource:   The select query (origin) - string - required
admin
pa rl load "reg1" "demo_cm_mysql" "id" "quantity" "select * from products limit 0, 500"
mentdb
1

pa rl load_from_json <regId> <jsonArray>

Description

    Load a linear regression from a JSON array of doubles

Parameters

    regId:   The regression id - string - required
    jsonArray:   The json array - string - required
admin
pa rl load_from_json "reg1" "[ [1.0, 2.0], [2.0, 3.0], [3.0, 4.0], [4.0, 5.0], [5.0, 6.0] ]"
mentdb
1

pa rl load_empty <regId>

Description

    Load an empty linear regression

Parameters

    regId:   The regression id - string - required
admin
pa rl load_empty "reg1"
mentdb
1

pa rl exist <regId>

Description

    Check if a regression already exist

Parameters

    regId:   The regression id - string - required
admin
pa rl exist "reg1"
mentdb
1

pa rl show

Description

    Show all regressions

admin
pa rl show
mentdb
[
"reg1"
]

pa rl add_data <regId> <x> <y>

Description

    Add data to a regression

Parameters

    regId:   The regression id - string - required
    x:   The x - number - required
    y:   The y - number - required
admin
pa rl add_data "reg1" 5 56
mentdb
1

pa rl slope <regId>

Description

    Get the slope (y = intercept + slope * x)

Parameters

    regId:   The regression id - string - required
admin
pa rl slope "reg1"
mentdb
7.25

pa rl intercept <regId>

Description

    Get the intercept (y = intercept + slope * x)

Parameters

    regId:   The regression id - string - required
admin
pa rl intercept "reg1"
mentdb
-11.5

pa rl predict <regId> <x>

Description

    Make a prediction

Parameters

    regId:   The regression id - string - required
    x:   The x - number - required
admin
pa rl predict "reg1" 12
mentdb
75.5

pa rl intercept_std_err <regId>

Description

    Returns the standard error of the intercept estimate, usually denoted s(b0).

Parameters

    regId:   The regression id - string - required
admin
pa rl intercept_std_err "reg1"
mentdb
19.764235376052373

pa rl mean_square_error <regId>

Description

    Returns the sum of squared errors divided by the degrees of freedom, usually abbreviated MSE.

Parameters

    regId:   The regression id - string - required
admin
pa rl mean_square_error "reg1"
mentdb
390.625

pa rl count <regId>

Description

    Get the number of couple

Parameters

    regId:   The regression id - string - required
admin
pa rl count "reg1"
mentdb
6

pa rl r <regId>

Description

    Returns Pearson's product moment correlation coefficient, usually denoted r.

Parameters

    regId:   The regression id - string - required
admin
pa rl r "reg1"
mentdb
0.5564589284286688

pa rl sum_squares <regId>

Description

    Returns the sum of squared deviations of the predicted y values about their mean (which equals the mean of y).

Parameters

    regId:   The regression id - string - required
admin
pa rl sum_squares "reg1"
mentdb
700.8333333333334

pa rl r_square <regId>

Description

    Returns the coefficient of determination, usually denoted r-square.

Parameters

    regId:   The regression id - string - required
admin
pa rl r_square "reg1"
mentdb
0.3096465390279824

pa rl significance <regId>

Description

    Returns the significance level of the slope (equiv) correlation.

Parameters

    regId:   The regression id - string - required
admin
pa rl significance "reg1"
mentdb
0.2514643980065754

pa rl slope_confidence_interval <regId>

Description

    Returns the half-width of a 95% confidence interval for the slope estimate.

Parameters

    regId:   The regression id - string - required
admin
pa rl slope_confidence_interval "reg1"
mentdb
15.027949957243381

pa rl slope_std_err <regId>

Description

    Returns the standard error of the slope estimate, usually denoted s(b1).

Parameters

    regId:   The regression id - string - required
admin
pa rl slope_std_err "reg1"
mentdb
5.412658773652741

pa rl sum_squared_errors <regId>

Description

    Returns the sum of squared errors (SSE) associated with the regression model.

Parameters

    regId:   The regression id - string - required
admin
pa rl sum_squared_errors "reg1"
mentdb
1562.5

pa rl total_sum_squares <regId>

Description

    Returns the sum of squared deviations of the y values about their mean.

Parameters

    regId:   The regression id - string - required
admin
pa rl total_sum_squares "reg1"
mentdb
2263.3333333333335

pa rl x_sum_squares <regId>

Description

    Returns the sum of squared deviations of the x values about their mean.

Parameters

    regId:   The regression id - string - required
admin
pa rl x_sum_squares "reg1"
mentdb
13.333333333333334

pa rl slope_confidence_interval <regId> <alpha>

Description

    Returns the half-width of a (100-100*alpha)% confidence interval for the slope estimate.

Parameters

    regId:   The regression id - string - required
    alpha:   The double alpha - number - not required
admin
pa rl slope_confidence_interval "reg1" 0.2
mentdb
51.80063969449396

pa rl close <regId>

Description

    Close a regression

Parameters

    regId:   The regression id - string - required
admin
pa rl close "reg1"
mentdb
1

pa rl close_all

Description

    Close all regressions

admin
pa rl close_all
mentdb
1

pa rm load <regId> <cmId> <fieldX1> <fieldX2> <fieldX3> <fieldX4> <fieldX5> <fieldY> <sqlSource>

Description

    Load a multiple regression from the database

Parameters

    regId:   The regression id - string - required
    cmId:   The database connection id - string - required
    fieldX1:   The field X1 - string - required
    fieldX2:   The field X2 - string - required
    fieldX3:   The field X3 - string - required
    fieldX4:   The field X4 - string - required
    fieldX5:   The field X5 - string - required
    fieldY:   The field X - string - required
    sqlSource:   The select query (origin) - string - required
admin
pa rm load "reg1" "demo_cm_mysql" "id" "quantity" "" "" "" "price" "select * from products limit 0, 500"
mentdb
1

pa rm load_from_json <regId> <jsonArrayX> <jsonArrayY>

Description

    Load a multilple regression from two JSON array of doubles

Parameters

    regId:   The regression id - string - required
    jsonArrayX:   The json array X - string - required
    jsonArrayY:   The json array Y - string - required
admin
pa rm load_from_json "reg1" "[ [ 1.0, 23.457 ], [ 2.0, 29.987 ], [ 3.0, 89.987 ], [ 4.0, 99.098 ], [ 5.0, 123.08 ] ]" "[7.5, 9.8, 14.7, 14.7, 19.4]"
mentdb
1

pa rm set_no_intercept <regId> <bool>

Description

    Set no intercept

Parameters

    regId:   The regression id - string - required
    bool:   The boolean - boolean - required
admin
pa rm set_no_intercept "reg1" true
mentdb
1

pa rm calculate_adjusted_r_squared <regId>

Description

    Returns the adjusted R-squared statistic, defined by the formula R2adj = 1 - [SSR (n - 1)] / [SSTO (n - p)]

Parameters

    regId:   The regression id - string - required
admin
pa rm calculate_adjusted_r_squared "reg1"
mentdb
0.9930302201822587

pa rm calculate_residual_sum_of_squares <regId>

Description

    Returns the sum of squared residuals.

Parameters

    regId:   The regression id - string - required
admin
pa rm calculate_residual_sum_of_squares "reg1"
mentdb
2.6787094169120644

pa rm calculate_r_squared <regId>

Description

    Returns the R-Squared statistic, defined by the formula R2 = 1 - SSR / SSTO

Parameters

    regId:   The regression id - string - required
admin
pa rm calculate_r_squared "reg1"
mentdb
0.9972120880729035

pa rm calculate_total_sum_of_squares <regId>

Description

    Returns the sum of squared deviations of Y from its mean.

Parameters

    regId:   The regression id - string - required
admin
pa rm calculate_total_sum_of_squares "reg1"
mentdb
960.8299999999999

pa rm estimate_error_variance <regId>

Description

    Estimates the variance of the error.

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_error_variance "reg1"
mentdb
1.3393547084560322

pa rm estimate_regressand_variance <regId>

Description

    Returns the variance of the regressand, ie Var(y).

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_regressand_variance "reg1"
mentdb
21.746999999999996

pa rm estimate_regression_standard_error <regId>

Description

    Estimates the standard error of the regression.

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_regression_standard_error "reg1"
mentdb
1.1573049332202954

pa rm estimate_regression_parameters_variance <regId>

Description

    Estimates the variance of the regression parameters, ie Var(b).

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_regression_parameters_variance "reg1"
mentdb
[
[
1.1939297361248733,
-0.6413091167219049,
0.012718472658507332
],
[
-0.6413091167219049,
1.3402027085716288,
-0.04621465840546843
],
[
0.012718472658507332,
-0.04621465840546843,
0.0017221335163781243
]
]

pa rm estimate_residuals <regId>

Description

    Estimates the residuals, ie u = y - X*b.

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_residuals "reg1"
mentdb
[
-0.21160225532182864,
0.39217249531173515,
0.5051039893042244,
-1.3403164432563521,
0.6546422139622123
]

pa rm estimate_regression_parameters_standard_errors <regId>

Description

    Returns the standard errors of the regression parameters.

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_regression_parameters_standard_errors "reg1"
mentdb
[
1.264553444360703,
1.3397786414221338,
0.04802653051960952
]

pa rm estimate_regression_parameters <regId>

Description

    Estimates the regression parameters b.

Parameters

    regId:   The regression id - string - required
admin
pa rm estimate_regression_parameters "reg1"
mentdb
[
5.036908634809639,
1.3187573895222953,
0.05780518527475357
]

pa rm predict <regId> <jsonX>

Description

    Make a prediction

Parameters

    regId:   The regression id - string - required
    jsonX:   The json that contains an array of x - string - required
admin
pa rm predict "reg1" "[12, 34]"
mentdb
22.827373608418803

pa rm exist <regId>

Description

    Check if a regression already exist

Parameters

    regId:   The regression id - string - required
admin
pa rm exist "reg1"
mentdb
1

pa rm show

Description

    Show all regressions

admin
pa rm show
mentdb
[
"reg1"
]

pa rm close <regId>

Description

    Close a regression

Parameters

    regId:   The regression id - string - required
admin
pa rm close "reg1"
mentdb
1

pa rm close_all

Description

    Close all regressions

admin
pa rm close_all
mentdb
1




© 2012 - 2019 - Innov-AI.