biwavelet - Error when plotting the graph - biwavelet

plot(wtc.AB, plot.cb = TRUE, plot.phase = TRUE)
Warning message:
In contour.default(x$t, yvals, t(tmp), level = tol, col = col.sig, :
all z values are NA
Does anyone know why this error happens?

Related

how to fix "File format b'file' not understood. Only 'RIFF' and 'RIFX' supported." error?

this is the error
f= open("my.dat" ,'wb')
i=0
for folder in os.listdir(directory):
i+=1
if i==11 :
break
for file in os.listdir(directory):
(rate,sig) = wav.read(directory+"/"+file)
mfcc_feat = mfcc(sig,rate ,winlen=0.020, appendEnergy = False)
covariance = np.cov(np.matrix.transpose(mfcc_feat))
mean_matrix = mfcc_feat.mean(0)
feature = (mean_matrix , covariance , i)
pickle.dump(feature , f)
f.close()
this code the wav.read is unable to be proccessed and the error is occured.

Training random forest (ranger) using caret with custom F4 metric in R yields but after running full ,error showing undefined columns selected

library(MLmetrics)
library(caret)
library(doSNOW)
library(ranger)
data is called as the "bank additional" full from this enter link description here and then following code to generate data1
library(VIM)
data1<-hotdeck(data,variable=c('job','marital','education','default','housing','loan'),domain_var = "y",imp_var=FALSE)
#converting the categorical variables to factors as they should be
library(magrittr)
data1%<>%
mutate_at(colnames(data1)[grepl('factor|logical|character',sapply(data1,class))],factor)
Now, splitting
library(caret)
#spliting data into train test 70/30
set.seed(1234)
trainIndex<-createDataPartition(data1$y,p=0.7,times = 1,list = F)
train<-data1[trainIndex,-11]
test<-data1[-trainIndex,-11]
levels(train$y)
train$y = as.factor(train$y)
# train$y = factor(train$y,levels = c("yes","no"))
# train$y = relevel(train$y,ref="yes")
Here, i got an idea of how to create F1 metric in Training Model in Caret Using F1 Metric
and using fbeta score formula i created f1_val; now i can't understand what lev,obs and pred are indicating . in my train dataset only column y showing data$obs , but no data$pred . So, is following error is due to this? and how to rectify this?
f1 <- function (data, lev = NULL, model = NULL) {
precision <- precision(data$obs,data$pred)
recall <- sensitivity(data$obs,data$pred)
f1_val <- (17*precision*recall)/(16*precision+recall)
names(f1_val) <- c("F1")
f1_val
}
tgrid <- expand.grid(
.mtry = 1:5,
.splitrule = "gini",
.min.node.size = seq(1,500,75)
)
model_caret <- train(train$y~., data = train,
method = "ranger",
trControl = trainControl(method="cv",
number = 2,
verboseIter = T,
classProbs = T,
summaryFunction = f1),
tuneGrid = tgrid,
num.trees = 500,
importance = "impurity",
metric = "F1")
After running for 3/4 minutes we get following :
Aggregating results
Selecting tuning parameters
Fitting mtry = 5, splitrule = gini, min.node.size = 1 on full training set
but error:
Error in `[.data.frame`(data, , all.vars(Terms), drop = FALSE) :
undefined columns selected
Also when running model_caret we get,
Error: object 'model_caret' not found
Kindly help. Thanks in advance

Problem with Tuning & Benchmark "surv.svm"

I get different error messages when I try to tune/benchmark "surv.svm".
For tuning I get the following error
Error in kernelMatrix(Xtrain = sv, kernel_type = kernel_type, kernel_pars = kernel_pars, : additiv kernel can not be applied on constant column
For benchmark I get the following error when poly_kernel is listed
Error in tcrossprod(K, Dc) : non-conformable arguments
When poly_kernel is removed, I get different error message
What is the problem and how to solve it?
task = tsk("actg")
learner = as_learner(ppl("distrcompositor",
learner = lrn("surv.svm", type = "regression",
kernel = to_tune(c("lin_kernel", "add_kernel", "rbf_kernel")),
gamma.mu = to_tune(p_dbl(-3, 1, trafo = function(x) 10^x))),
estimator = "kaplan", form = "ph"))
set.seed(82721)
inner_cv = rsmp("cv", folds = 2)
at_learner = AutoTuner$new(learner = learner,
resampling = inner_cv,
measure = msr("surv.cindex"),
terminator = trm("evals", n_evals = 96),
tuner = tnr("irace"))
at_learner$train(task)

AddDataField function fails with Microsoft.Office.Interop.Excel

I am trying to recreate VBA code in C# to generate a pivot table
The VBA code is
Sheets.Add
ActiveWorkbook.PivotCaches.Create(SourceType:= xlDatabase, SourceData:= _
"Sheet1!R1C1:R6C4", Version:= 6).CreatePivotTable TableDestination:= _
"Sheet2!R3C1", TableName:= "PivotTable1", DefaultVersion:= 6
Sheets("Sheet2").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields("First Name")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables(_
"PivotTable1").PivotFields("Salary"), "Sum of Salary", xlSum
using Excel = Microsoft.Office.Interop.Excel;
...
//Start of pivot code
workbook.Worksheets.Add();
//ideally would want a "used range" here not specific cell addresses Sheet1!R1C1:R6C4
pivotcache = (Excel.PivotCache)excel.ActiveWorkbook.PivotCaches().Create(Excel.XlPivotTableSourceType.xlDatabase, "Sheet1!R1C1:R6C4", 6); // Const xlDatabase = 1 Member of Excel.XlPivotTableSourceType
pivot = pivotcache.CreatePivotTable("Sheet2!R3C1", "PivotTable1", 6);
sheet = (Excel.Worksheet) workbook.Worksheets["Sheet2"];
range = sheet.get_Range("A3");
range.Select();
pf = pivot.PivotFields("First Name");
pf.Orientation=XlPivotFieldOrientation.xlRowField; //1=xlrowfield
pf.Position = 1;
//*****Code fails here ***
df = pivot.AddDataField(pivot.PivotFields("Salary"), "Sum of Salary", XlConsolidationFunction.xlSum); //Const xlSum = -4157 (&HFFFFEFC3) Member of Excel.XlConsolidationFunction
The last line fails with console error message: Error: Operation is not supported on this platform. Line: System.Private.CoreLib
Can anyone give me some pointers?
Disaggregating the code and adding orientation xlDataField like this worked
df = pivot.PivotFields("Salary");
df.Orientation = XlPivotFieldOrientation.xlDataField;
df.Function = Excel.XlConsolidationFunction.xlSum;
df.Caption = "Sum of Salary";

How to resolve problem with es_extended Fivem (Lua)

i have a problem with es_extended.
I have this error :
SCRIPT ERROR: #es_extended/client/main.lua:64: attempt to index a nil value (field 'coords')
Thank you in advance.
This could be fixed by checking if the coordinates have a value before attempting to teleport the player.
if playerData.coords == nil and playerData.coords.x == nil then playerData.coords = {x = -1070.906250, y = -2972.122803, z = 13.773568} end
ESX.Game.Teleport(PlayerPedId(), {
x = playerData.coords.x,
y = playerData.coords.y,
z = playerData.coords.z + 0.25
}, function()
TriggerServerEvent('esx:onPlayerSpawn')
TriggerEvent('esx:onPlayerSpawn')
TriggerEvent('playerSpawned') -- compatibility with old scripts, will be removed soon
TriggerEvent('esx:restoreLoadout')
Citizen.Wait(3000)
ShutdownLoadingScreen()
FreezeEntityPosition(PlayerPedId(), false)
DoScreenFadeIn(10000)
StartServerSyncLoops()
end)

Resources