sábado, junho 28, 2025
Sem resultados
Visualizar todos os resultados
O Verídico
  • Principal
  • Política
  • Amazonas
  • Brasil
  • Mundo
  • Judiciário
  • Economia
  • Principal
  • Política
  • Amazonas
  • Brasil
  • Mundo
  • Judiciário
  • Economia
Sem resultados
Visualizar todos os resultados
O Verídico
Sem resultados
Visualizar todos os resultados

How to Execute R/Python in SQL Server with Machine Learning Services

por marceloleite
18 de maio de 2018
no Sem categoria
0
How to Execute R/Python in SQL Server with Machine Learning Services
0
Compartilhamentos
9
Visualizações
Share on FacebookShare on Twitter

Machine Learning Services in SQL Server, brings AI directly to your data: https://aka.ms/SQLMLOverview.

No more need to move data around or work on samples. You can operationalize your R and Python machine learning models directly within your enterprise grade database server. SQL Machine Learning Services enables you to work with any open source packages and additionally provides algorithms which enable multi-threaded, parallel processing for industry leading scale and performance.

If you don’t have Machine Learning Services in SQL Server installed or enabled, check out these other related how-to videos:
How to Install Machine Learning Services in SQL Server: https://aka.ms/InstallMLServices
How to Enable R/Python Code Execution in SQL Server: https://aka.ms/EnableMLServices

PUBLICIDADE

Visit our documentation to learn more advanced techniques like how to remotely execute R/Python in SQL Server from your own IDE like Jupyter Notebooks, PyCharm, RStudio, etc.

Advanced Execution Documentation: https://aka.ms/ExecuteSQLMLDocs

Here is code from the video for quick copy/paste:
Basic:
EXEC sp_execute_external_script @language = N’Python’, @script = N’print(3+4)’

Input parameter:
EXEC sp_execute_external_script @language =N’Python’,
@script=N’
OutputDataSet = InputDataSet;
‘,
@input_data_1 =N’SELECT 1 AS Col1′;

Input/Output name:
EXEC sp_execute_external_script @language =N’Python’,
@script=N’
MyOutput = MyInput;
‘,
@input_data_1_name = N’MyInput’,
@input_data_1 =N’SELECT 1 AS foo’,
@output_data_1_name =N’MyOutput’;

Result Column Name:
EXEC sp_execute_external_script @language =N’Python’,
@script=N’
MyOutput = MyInput;
‘,
@input_data_1_name = N’MyInput’,
@input_data_1 =N’
SELECT 1 AS foo,
2 AS bar
‘,
@output_data_1_name =N’MyOutput’
WITH RESULT SETS ((MyColName int, MyColName2 int));

Pandas Dataframe conversion:
EXEC sp_execute_external_script @language =N’Python’,
@script=N’
import pandas as pd
c = 1/2
d = 1*2
s = pd.Series([c,d])
df = pd.DataFrame(s)
OutputDataSet = df
‘

Pandas Dataframe conversion 2:
EXEC sp_execute_external_script @language =N’Python’,
@script=N’
import pandas as pd
s = {“col1”: [1, 2], “col2”: [3, 4]}
df = pd.DataFrame(s)
OutputDataSet = df
‘

marceloleite

marceloleite

Próxima notícia
Following Chevron’s Azure Migration Journey

Following Chevron’s Azure Migration Journey

Recommended

Confúcio registra esvaziamento do campus da UNIR em Ariquemes

Confúcio registra esvaziamento do campus da UNIR em Ariquemes

4 anos ago
Coij e Esmam promovem evento com participação de prefeitos para discutir fortalecimento da rede de proteção a crianças e adolescentes vítimas de violência

Coij e Esmam promovem evento com participação de prefeitos para discutir fortalecimento da rede de proteção a crianças e adolescentes vítimas de violência

4 anos ago
  • Principal
  • Política
  • Amazonas
  • Brasil
  • Mundo
  • Judiciário
  • Economia

Sem resultados
Visualizar todos os resultados
  • Principal
  • Política
  • Amazonas
  • Brasil
  • Mundo
  • Judiciário
  • Economia