Encontrar

Question
· Feb 6

I don't know what I did wrong.

I set up all the credentials and IP, Port, Namespace, SSL/TLS Server Name and .ini file but I still cannot connect to db. and It says 

Iris ODBC][State : 08S01][Native Code 459]
[C:\Windows\system32\odbcad32.exe]
Connection via irisconnect failed: 
Matching SSL server config not found in ssldefs.ini or registry

2 Comments
Discussion (2)1
Log in or sign up to continue
Article
· Feb 6 3m read

Configuração e Aplicação do IntegratedML no InterSystems IRIS

Introdução

O IntegratedML é uma ferramenta poderosa do InterSystems IRIS que permite a criação, treinamento e gerenciamento de modelos de machine learning diretamente no banco de dados, utilizando SQL. Neste artigo, abordaremos a configuração do IntegratedML e sua aplicação em cenários reais, utilizando exemplos SQL que refletem seus dados.

Configuração do IntegratedML

Uma configuração de ML (“ML Configuration”) define o provedor de machine learning que executará o treinamento, além de outras informações necessárias. O IntegratedML possui uma configuração padrão chamada %AutoML, já ativada após a instalação do InterSystems IRIS.

Criando Configuração de ML

Para criar uma nova configuração de ML, podemos utilizar o System Management Portal ou comandos SQL.

Criando Configuração de ML via SQL:

CREATE ML CONFIGURATION MeuMLConfig PROVIDER AutoML USING {'verbosity': 1};

Para definir essa configuração como padrão:

SET ML CONFIGURATION MeuMLConfig;

Para visualizar as configurações de treinamento:

SELECT * FROM INFORMATION_SCHEMA.ML_TRAINING_RUNS;

Aplicação do IntegratedML

Criando um modelo preditivo para estimar a quantidade de energia gerada por uma unidade consumidora:

CREATE MODEL PredicaoEnergia PREDICTING (quantidade_gerada) FROM UnidadeConsumidora;

Treinando o modelo:

TRAIN MODEL PredicaoEnergia;

Fazendo previsões:

SELECT quantidade_gerada, PREDICT(PredicaoEnergia) AS previsao FROM UnidadeConsumidora WHERE id = 1001;

Implementação: Machine Learning na Energia Solar

1. Integração de Dados com IRIS

Extraímos dados essenciais de múltiplas tabelas para construção do dataset:

SELECT PSID, CHNNLID, TYPENAME, DEVICESN, DEVICETYPE, FACTORYNAME, STATUS FROM datafabric_solar_bd.EQUIPAMENTS;

2. Treinamento de Modelo de Manutenção Preditiva

Utilizando Python Embedded no IRIS para treinar um modelo de manutenção preditiva:

from sklearn.ensemble import RandomForestClassifier
from iris import irispy # Carregar dados
sql_query = "SELECT PSID, DEVSTATUS, ALARMCOUNT FROM datafabric_solar_bd.USINAS;"
data = irispy.sql(sql_query) # Treinar o modelo
model = RandomForestClassifier()
model.fit(data[['DEVSTATUS', 'ALARMCOUNT']], data['PSID'])

3. Previsão da Produção de Energia

Utilizando análise de séries temporais para prever a produção de energia diária:

from fbprophet import Prophet # Preparar dataset
df = irispy.sql("SELECT STARTTIMESTAMP, PRODDAYPLANT FROM datafabric_solar_bd.POINTMINUTEDATA;")
df.rename(columns={'STARTTIMESTAMP': 'ds', 'PRODDAYPLANT': 'y'}, inplace=True) # Treinar modelo de previsão
model = Prophet()
model.fit(df)
future = model.make_future_dataframe(periods=30)
forecast = model.predict(future)

4. Identificação de Áreas de Alta Irradiação Solar

A análise de dados geoespaciais permite identificar zonas com maior potencial de geração de energia solar, otimizando a alocação de recursos.

Conclusão

O IntegratedML facilita a implementação de machine learning no InterSystems IRIS, permitindo que modelos sejam treinados e aplicados diretamente via SQL. Além disso, o uso de técnicas de machine learning para manutenção preditiva e previsão de geração de energia pode melhorar a eficiência operacional das usinas solares.

Discussion (0)1
Log in or sign up to continue
Article
· Feb 6 3m read

IntegratedML Configuration and Application in InterSystems IRIS

Overview

 

With the help of SQL, you can build, train, and manage machine learning models directly in the database with InterSystems IRIS's robust IntegratedML tool. Using SQL examples that represent your data, we will go over IntegratedML configuration and how it is used in practical situations in this article.

 

IntegratedML Configuration

 

A ML configuration (“ML Configuration”) defines the machine learning provider that will perform the training, in addition to other necessary information. IntegratedML has a default configuration called %AutoML, already activated after installing InterSystems IRIS.

Creating ML Configuration

To create a new ML configuration, we can use the System Management Portal or SQL commands.

Creating ML Configuration via SQL:

CREATE ML CONFIGURATION MeuMLConfig PROVIDER AutoML USING {'verbosity': 1};

To set this configuration as default:

SET ML CONFIGURATION MeuMLConfig;

To view the training settings:

SELECT * FROM INFORMATION_SCHEMA.ML_TRAINING_RUNS;

IntegratedML Application

Creating a predictive model to estimate the amount of energy generated by a consumer unit:

CREATE MODEL PredicaoEnergia PREDICTING (quantidade_generada) FROM UnidadeConsumidora;

Training the model:

TRAIN MODEL PredicaoEnergia;

Making predictions:

SELECT quanto_generada, PREDICT(PredicaoEnergia) AS predicao FROM UnidadeConsumidora WHERE id = 1001;

Implementation: Machine Learning in Solar Energy

1. Data Integration with IRIS

We extracted essential data from multiple tables to build the dataset:

SELECT PSID, CHNNLID, TYPENAME, DEVICESN, DEVICETYPE, FACTORYNAME, STATUS FROM datafabric_solar_bd.EQUIPAMENTS;

2. Predictive Maintenance Model Training

Using Python Embedded in IRIS to train a predictive maintenance model:

from sklearn.ensemble import RandomForestClassifier

from iris import irispy

 

# Load data

sql_query = "SELECT PSID, DEVSTATUS, ALARMCOUNT FROM datafabric_solar_bd.USINAS;" data = irispy.sql(sql_query)

 

# Train the model

model = RandomForestClassifier()

model.fit(data[['DEVSTATUS', 'ALARMCOUNT']], data['PSID'])

3. Forecasting Energy Production

Using time series analysis to forecast daily energy production:

from fbprophet import Prophet

 

# Prepare dataset

df = irispy.sql("SELECT STARTTIMESTAMP, PRODDAYPLANT FROM datafabric_solar_bd.POINTMINUTEDATA;")

df.rename(columns={'STARTTIMESTAMP': 'ds', 'PRODDAYPLANT': 'y'}, inplace=True)

 

# Train forecasting model

model = Prophet()

model.fit(df)

future = model.make_future_dataframe(periods=30)

forecast = model.predict(future)

4. Identifying Areas of High Solar Irradiance

The analysis of geospatial data allows the identification of areas with the greatest potential for solar energy generation, optimizing resource allocation.

Conclusion

IntegratedML makes it easier to implement machine learning in InterSystems IRIS by allowing models to be trained and applied directly using SQL. Furthermore, using machine learning techniques for predictive maintenance and energy generation forecasting can help solar plants operate more efficiently

1 Comment
Discussion (1)1
Log in or sign up to continue
Question
· Feb 6

Sorting, remove duplicate and count of Json file

My usecase is sorting and removing duplicates and getting count from a file that has json messages as a individual rows.

I am currently planning to use pandas for this purpose as its really fast. Below are the steps i am following

1) call a python function (called function) from IRIS classmethod(calling function)

2) the call python function will read the json file in a dataframe

3) perform sorting, dup removal, count in the dataframe

4) convert the dataframe into iris stream

5) return back the stream to iris calling function class method

When i try to write the stream into termial its coming as a %SYS.python object rather a iris stream object.

Below is what my questions are

1) why is the return a %Sys.python rather a iris stream object

2) is there a better way to implement sorting, dup removals n count of record, in a file within iris.

Thanks!

6 Comments
Discussion (6)2
Log in or sign up to continue
Discussion (9)1
Log in or sign up to continue