Currently i am using dcmtk for pac and modality console communication . In dcmtk one execute file is there dcmmkcrv. It is used for store the curve data in dcm file.
Now my question is ,
what is curve data ? I need some example for that curve data.
The description for Curve Data can be found in a deprecated DICOM Standart of 2004.
The standart is available here: http://dicom.nema.org/dicom/2004/04_03PU3.PDF
Page 681 - C.10.2.1.4 Curve data
Note that after 2004 Curve data is not defined within the DICOM standart anymore.
Related
I'm building a species distribution model/habitat suitability model using the package biomod2.
Maxent allows the user to choose one of four output formats (see title) when the Java application is used directly. However, when Maxent is called by functions in the package biomod2 (e.g. BIOMOD_Modeling) there doesn't seem to be an option to specify the output format. Nor is there any indication which one has been chosen. I think cloglog is the default so it is likely that one but I would like to be sure.
This tutorial has some images showing the differences between some of the outputs: https://biodiversityinformatics.amnh.org/open_source/maxent/Maxent_tutorial2017.pdf
Thanks for your help!
I emailed the developers and Damien Georges told me that the output format for MAXENT in biomod2 is logistic and that (so far) there is no way to change it
Problem:
I have a Random Forest model trained in R. I need to deploy this model in a standalone Excel tool that will be used by 350 people across a sales network to perform real-time predictions based on data entered into the spreadsheet by users.
How can I do this?
Constraints:
It is not an option to require users to install R on their local machines.
It is not an option to have a server (physical or cloud) providing a scoring API.
What have I done so far?
1. PMML
I can export the model in PMML (XML structure). From research I can see there are libraries for loading and executing PMML inputs in Python and Java. However I haven't found anything implemented in VBA / VB.
2. Zementis
I looked into a solution called Zementis which offers an Excel add-in to deploy PMML models. However from my understanding this requires web-service calls to a cloud server (e.g. AWS) where the actual model execution happens. My IT security department will not allow this.
3. Others
The most common recommendation seems to be to call R to load the model and run the predict function. As noted above, this is not a viable option.
Detailed Context:
The Random Forest model is trained in R, with c. 30 variables. The model is used to recommend "personalised" prices for products as part of a sales process.
The model needs to be distributed to the sales network, with about 350 users. The business's preference is to integrate the model into an existing spreadsheet tool that sales teams currently use to calculate deal profitability.
This means that I need to be able to export the model in a way that it can be implemented in Excel VBA.
Given timescales, the implementation needs to be self-contained with no IT infrastructure or additional application installs. We are working with the organisation's IT team on a server based solution, however their deployment timescales are 12 months+ which means we need a tactical solution in the short-term.
Here's one approach to get the "rules" for the trees (example using the mtcars dataset)
install.packages("randomForest")
library(randomForest)
head(mtcars)
set.seed(1)
fit <- randomForest(mpg ~ ., data=mtcars, importance=TRUE, proximity=TRUE)
print(fit)
## Look at variable importance:
importance(fit)
# Print the rules for each tree in the forest
install.packages("rattle")
library(rattle)
printRandomForests(fit)
It is probably unrealistic to use the rules for 500 trees, but maybe you could implement 100 trees in your vba and then take an average of the results (for a continuous response) or predict the class with the most votes across the trees (for a categorical response).
Maybe you could recreate the model on a Worksheet.
As far as I know, Excel can import XML structures (on the Development Tools ribbon).
Edit: 1) save pmml structure in plaintext editor as .xml file.
2) Open the file in Excel 2013 (maybe other versions also do it)
3) Click through the error message and open the file anyway. Trees open as a table, a bit funny, but recognizable.
4) Create prediction calculation (generic fn in VBA) to operate on the tree.
I have a dataset, downloaded from link.
I know about coremltool (created by Apple).
The question is:
is it possible to convert Stanford dataset to CoreML ?
If yes - can somebody give me instructions ?
Thanks in advance !
This question is asked so often, that finally I've decided to draw a diagram.
Explanation:
Dataset is a "fuel" that you put into your model to make it work.
Model is a machine learning algorithm: neural network, decision tree etc.
Supported ML frameworks and models are listed here together with the instructions for conversion.
You can make your own .mlmodel file using your own data set with a python script and a python library called coremltools. You can train your model using sklearn, keras, etc. and can customize what is uses to train like SVM, kNN, regression, and so on. Then you save it as a .mlmodelfile and drop that into your project. This video is helpful:
https://youtu.be/T4t73CXB7CU
I created an xml file using pmml function from pmml library in R.
adamodel_iOS=ada(label~.,data=train_iOS, iter=ntrees, verbose=TRUE, loss="ada", bag.frac=0.7, nu=0.1, control=defctrl, type="real")
Ptrain_iOS = predict(adamodel_iOS,newdata=train_iOS, type="prob")
library(pmml)
adapmml_iOS=pmml(adamodel_iOS)
saveXML(adapmml_iOS,"model_iOS.xml")
save.image()
After, training model in the first line, I found the corresponding probabilities for the training data.
Now I want to use this xml file to generate predictions on a set of data(basically the training set again). How do I do that in R? I see that in java and spark, we can load xml file generated by pmml function and then there are functions which can make predictions.
Basically, I am looking for a function in R that can take this xml file as an input and then return an object which in turn takes some datapoints as input and return their probabilities of having label 0 and 1.
I found a link:
Can PMML models be read in R?
but it does not help
Check this link for the list of PMML producers and consumers. As you can see R is listed as producer not consumer. Also, algorithms for which R can produce the corresponding PMML files are listed.
The most comprehensive tool for PMML validator, convertor, and also for scoring data using PMML models is ADAPA, which is not free.
KNIME is an open source drag & drop analytics tool which supports both import and export of PMML files (not for all models and the features are limited.) It supports R, Python, and Java too.
Although it's a long time ago, I still want to share that you can use the "reticulate" to call the python pypmml package to implement your ideas in R, and in order to be more friendly and make the prediction look more like the predict function in R, I will It is encapsulated, the address of the package is here enter link description here
I am pretty new to the RNetLogo package in R, but so far all the examples of using RNetLogo I saw were about loading model samples and doing something with them. I did not see any examples which show that we can create our own model and write down rules according to which our agents will interact with each other (or see the code of sample models and change it). Is it possible to write these rules in R or does RNetLogo allow us to play with already implemented models (samples) only without changing the code?
For example, when we open in NetLogo Models Library-->Earth Science-->Climate Change (just random example) then we can go to the Code tab and see the code written in NetLogo prog.language:
globals [
sky-top ;; y coordinate of top row of sky
...
My question is: can we see this code in R and change it?
My answer, I do not think so :-) . You need to developpe your model in netlogo and with RNetlogo in R you can run it, play with data, send some data.frame to your model, change some variable.