<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python Evaluation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-Evaluation/m-p/3289063#M122395</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Can anybody with Python experience test my code and let's compare answers/notes, please?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;BR /&gt;import numpy as np&lt;BR /&gt;import tensorflow as tf&lt;BR /&gt;from tensorflow.keras import layers&lt;/P&gt;&lt;P&gt;abalone_train = pd.read_csv(&lt;BR /&gt;r"C:\Users\Anthony.DESKTOP-ES5HL78\Downloads\abalone.data",&lt;BR /&gt;sep=“,”,&lt;BR /&gt;names=[&lt;BR /&gt;“Sex”, “Length”, “Diameter”, “Height”, “Whole weight”,&lt;BR /&gt;“Shucked weight”, “Viscera weight”, “Shell weight”, “Age”&lt;BR /&gt;]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# Perform one-hot encoding for the ‘Sex’ column&lt;/P&gt;&lt;P&gt;abalone_train = pd.get_dummies(abalone_train, columns=[‘Sex’])&lt;/P&gt;&lt;P&gt;abalone_features = abalone_train.copy()&lt;BR /&gt;abalone_labels = abalone_features.pop(‘Age’)&lt;/P&gt;&lt;P&gt;# Convert to numpy array and float32 data type&lt;/P&gt;&lt;P&gt;abalone_features = abalone_features.astype(‘float32’)&lt;BR /&gt;abalone_labels = abalone_labels.astype(‘float32’)&lt;/P&gt;&lt;P&gt;# Create a sequential model&lt;/P&gt;&lt;P&gt;model = tf.keras.Sequential([&lt;BR /&gt;layers.Dense(64, activation=‘relu’),&lt;BR /&gt;layers.Dense(1)&lt;BR /&gt;])&lt;/P&gt;&lt;P&gt;# Compile the model&lt;/P&gt;&lt;P&gt;model.compile(optimizer=tf.keras.optimizers.Adam(), loss=tf.keras.losses.MeanSquaredError())&lt;/P&gt;&lt;P&gt;# Fit the model&lt;/P&gt;&lt;P&gt;history = model.fit(abalone_features, abalone_labels, epochs=10, verbose=0)&lt;/P&gt;&lt;P&gt;# Print history and model summary&lt;/P&gt;&lt;P&gt;print(history.history)&lt;BR /&gt;model.summary()&lt;/P&gt;&lt;P&gt;{ [74.98324584960938, 12.322690963745117, 7.765621185302734, 7.502653121948242, 7.229104518890381, 6.997042179107666, 6.799757957458496, 6.645227432250977, 6.521533489227295, 6.418800354003906]}&lt;BR /&gt;Model: “sequential”&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Layer (type) Output Shape Param #&lt;/P&gt;&lt;P&gt;dense (Dense) (None, 64) 704&lt;/P&gt;&lt;P&gt;dense_1 (Dense) (None, 1) 65&lt;/P&gt;&lt;P&gt;=================================================================&lt;BR /&gt;Total params: 769&lt;BR /&gt;Trainable params: 769&lt;BR /&gt;Non-trainable params: 0&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Data for this Question: [&lt;A href="https://drive.google.com/file/d/1iSgWZUK…" target="_blank"&gt;https://drive.google.com/file/d/1iSgWZUK…&lt;/A&gt;sp=sharing](&lt;A href="https://drive.google.com/file/d/1iSgWZUK23Gw6R-2rUkKeEOl6BIwms8L8/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1iSgWZUK23Gw6R-2rUkKeEOl6BIwms8L8/view?usp=sharing&lt;/A&gt;)&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Jun 2023 19:07:23 GMT</pubDate>
    <dc:creator>Yrstruly2021</dc:creator>
    <dc:date>2023-06-17T19:07:23Z</dc:date>
    <item>
      <title>Python Evaluation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-Evaluation/m-p/3289063#M122395</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Can anybody with Python experience test my code and let's compare answers/notes, please?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;BR /&gt;import numpy as np&lt;BR /&gt;import tensorflow as tf&lt;BR /&gt;from tensorflow.keras import layers&lt;/P&gt;&lt;P&gt;abalone_train = pd.read_csv(&lt;BR /&gt;r"C:\Users\Anthony.DESKTOP-ES5HL78\Downloads\abalone.data",&lt;BR /&gt;sep=“,”,&lt;BR /&gt;names=[&lt;BR /&gt;“Sex”, “Length”, “Diameter”, “Height”, “Whole weight”,&lt;BR /&gt;“Shucked weight”, “Viscera weight”, “Shell weight”, “Age”&lt;BR /&gt;]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# Perform one-hot encoding for the ‘Sex’ column&lt;/P&gt;&lt;P&gt;abalone_train = pd.get_dummies(abalone_train, columns=[‘Sex’])&lt;/P&gt;&lt;P&gt;abalone_features = abalone_train.copy()&lt;BR /&gt;abalone_labels = abalone_features.pop(‘Age’)&lt;/P&gt;&lt;P&gt;# Convert to numpy array and float32 data type&lt;/P&gt;&lt;P&gt;abalone_features = abalone_features.astype(‘float32’)&lt;BR /&gt;abalone_labels = abalone_labels.astype(‘float32’)&lt;/P&gt;&lt;P&gt;# Create a sequential model&lt;/P&gt;&lt;P&gt;model = tf.keras.Sequential([&lt;BR /&gt;layers.Dense(64, activation=‘relu’),&lt;BR /&gt;layers.Dense(1)&lt;BR /&gt;])&lt;/P&gt;&lt;P&gt;# Compile the model&lt;/P&gt;&lt;P&gt;model.compile(optimizer=tf.keras.optimizers.Adam(), loss=tf.keras.losses.MeanSquaredError())&lt;/P&gt;&lt;P&gt;# Fit the model&lt;/P&gt;&lt;P&gt;history = model.fit(abalone_features, abalone_labels, epochs=10, verbose=0)&lt;/P&gt;&lt;P&gt;# Print history and model summary&lt;/P&gt;&lt;P&gt;print(history.history)&lt;BR /&gt;model.summary()&lt;/P&gt;&lt;P&gt;{ [74.98324584960938, 12.322690963745117, 7.765621185302734, 7.502653121948242, 7.229104518890381, 6.997042179107666, 6.799757957458496, 6.645227432250977, 6.521533489227295, 6.418800354003906]}&lt;BR /&gt;Model: “sequential”&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;# Layer (type) Output Shape Param #&lt;/P&gt;&lt;P&gt;dense (Dense) (None, 64) 704&lt;/P&gt;&lt;P&gt;dense_1 (Dense) (None, 1) 65&lt;/P&gt;&lt;P&gt;=================================================================&lt;BR /&gt;Total params: 769&lt;BR /&gt;Trainable params: 769&lt;BR /&gt;Non-trainable params: 0&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;## Data for this Question: [&lt;A href="https://drive.google.com/file/d/1iSgWZUK…" target="_blank"&gt;https://drive.google.com/file/d/1iSgWZUK…&lt;/A&gt;sp=sharing](&lt;A href="https://drive.google.com/file/d/1iSgWZUK23Gw6R-2rUkKeEOl6BIwms8L8/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1iSgWZUK23Gw6R-2rUkKeEOl6BIwms8L8/view?usp=sharing&lt;/A&gt;)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jun 2023 19:07:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Python-Evaluation/m-p/3289063#M122395</guid>
      <dc:creator>Yrstruly2021</dc:creator>
      <dc:date>2023-06-17T19:07:23Z</dc:date>
    </item>
  </channel>
</rss>

