Optimizing SMO with RBFKernel (C and gamma) in Weka
By : user3837939
Date : March 29 2020, 07:55 AM
help you fix your problem This is what worked for me: Using logarithmic steps XExpression = pow(BASE,I), XMin = 5, XMax = 5, XStep = 1 and XBase = 10 (same for Y). Using a filter For my purposes I used a DistributionBasedBalance filter with p set to some value. Increasing the number of execution slots I set numExecutionSlots to 4 (the number of cores in my machine).

gamma correction formula : .^(gamma) or .^(1/gamma)?
By : Ashish poojary
Date : March 29 2020, 07:55 AM

R for optimizing a function which involves the gamma function
By : S. Rodgers
Date : March 29 2020, 07:55 AM
To fix the issue you can do I am trying to optimize a function which involves a gamma function. my data is a censored data. The error, that I am having is: "Error in fn(par, ...) : attempt to apply nonfunction" the R code is: , In code :
d*log(w2theta[3](nd2)) D*log(w1+theta[3](nd2))
d*log(w2theta[3]*(nd2)) D*log(w1+theta[3]*(nd2))

Equation of rbfKernel in kernlab is different from the standard?
By : Mark Howes
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I came across that discrepancy too and I wound up digging into the source to figure out if there was a typo in the documentation or what was going on exactly since sigma in the context of Gaussians traditionally goes as the standard deviation in the denominator right? Here's the relevant source code :
**kernlab\R\kernels.R**
## Define the kernel objects,
## functions with an additional slot for the kernel parameter list.
## kernel functions take two vector arguments and return a scalar (dot product)
rbfdot< function(sigma=1)
{
rval < function(x,y=NULL)
{
if(!is(x,"vector")) stop("x must be a vector")
if(!is(y,"vector")&&!is.null(y)) stop("y must a vector")
if (is(x,"vector") && is.null(y)){
return(1)
}
if (is(x,"vector") && is(y,"vector")){
if (!length(x)==length(y))
stop("number of dimension must be the same on both data points")
return(exp(sigma*(2*crossprod(x,y)  crossprod(x)  crossprod(y))))
# sigma/2 or sigma ??
}
}
return(new("rbfkernel",.Data=rval,kpar=list(sigma=sigma)))
}

Get random gamma distribution in tensorflow like numpy.random.gamma
By : Akbar Ebadzadeh
Date : March 29 2020, 07:55 AM
around this issue You are setting different shape parameters in your distribution, so it is expected that they differ. One thing to watch out for is that numpy has a "scale" parameter while TF has an "inverse scale" parameter. So one has to be inverted to get the same distribution. code :
%matplotlib inline
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
size = (50000,)
shape_parameter = 1.5
scale_parameter = 0.5
bins = np.linspace(1, 5, 30)
np_res = np.random.gamma(shape=shape_parameter, scale=scale_parameter, size=size)
# Note the 1/scale_parameter here
tf_op = tf.random_gamma(shape=size, alpha=shape_parameter, beta=1/scale_parameter)
with tf.Session() as sess:
tf_res = sess.run(tf_op)
plt.hist(tf_res, bins=bins, alpha=0.5);
plt.hist(np_res, bins=bins, alpha=0.5);

